Friday, February 20, 2015

Nitheen Kumar

REPLACE Function in SQL Server

 
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

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%'
Subscribe to get more Posts :