STUFF Function in SQL Server 2008
In this article i will explain how to use STUFF Function in SQL.
STUFF() function is used to delete a certain length of the string and a new string is inserted at the deleted place. It is used to stuff a string into another string.
STUFF (InputString, start, length, ReplaceString)
InputString- Input string specifies the string in which replacement is to be done.
start- starting point from where string is to be replaced.
length- number of characters to be replaced
Suppose we have table named Employee as.
Replace four characters of L_Name column to "XX" from 2nd position in Employee table.