REPLACE Function In SQL Server 2008
In this article i will explain how to use REPLACE Function in SQL.
STUFF() function is used to replaces all occurrences of a string with new characters.
REPLACE (InputString, StringToReplace, NewString)
InputString- Input string specifies the string in which replacement is to be done.
StringToReplace- Specifies the sequence of characters to be replaced.
NewString- New string replaced to original string
Suppose we have table named Employee as.
Replace all occurrence of "agarwal" in L_Name column with "KAPOOR".