SQL Server String Functions
SQL Server string functions are scalar functions that perform an operation on a string input value and return a string or numeric value.
REPLACE function replaces some characters within a string with another set of characters. The syntax is:
REPLACE(string expression, value to be replaced, replacing value)
For example, the following query replaces each occurrence of the word "payable" with "receivable":
SELECT AccountDescription, REPLACE(AccountDescription, 'payable', 'receivable') AS DreamOn
FROM dimAccount WHERE AccountDescription LIKE '%payable%'
Tags:
SQL Server string functions are scalar functions that perform an operation on a string input value and return a string or numeric value.
REPLACE Function
REPLACE function replaces some characters within a string with another set of characters. The syntax is:
REPLACE(string expression, value to be replaced, replacing value)
For example, the following query replaces each occurrence of the word "payable" with "receivable":
SELECT AccountDescription, REPLACE(AccountDescription, 'payable', 'receivable') AS DreamOn
FROM dimAccount WHERE AccountDescription LIKE '%payable%'