The stuff() function deletes a part of the string and then inserts another part into the string, starting at a specified position.
Syntax:
STUFF(String1, Position, Length, String2)
Here, String1 is the one that will be overwritten. The position indicates the starting location for overwriting the string. Length is the length of the substitute string, and String2 is the string that will overwrite String1.
Example:
select stuff(‘SQL Tutorial’,1,3,’Python’)
This will change ‘SQL Tutorial’ to ‘Python Tutorial’
Output:
Python Tutorial