Saturday, 26 March 2016

Use Of Replace Function in SQL Server

Replace function is used to replace the exact occurrence of the String in a Expression 

Syntax : 

REPLACE '[STRING EXPRESSION]','[STRING TO FOUND]',[REPLACEMENT STRING]

Example :

SELECT REPLACE('JK SQL SEVER BLOG','SEVER','SERVER') 

In above example 'SEVER' will be replaced with replacement string 'SERVER' in the string expression.

Note : Replace function will replace all the exact occurrence of the string expression
rather than replacing particular string occurrence.

No comments:

Post a Comment