What is difference between STUFF and REPLACE in SQL Server?
REPLACE is used to replace all the occurances of the given pattern in a string.
Example: select Replace('Nirav','N','R')
STUFF: This function is used to replace the part of string with some other string.
syntax: STUFF (stringexpression, start, length, replacementcharacters)
Example:SELECT STUFF('Nirav''s Blog is USEFUL',9,4,'DATABASE')
Output: Nirav's DATABASE is USEFUL
SQL Server Interview Questions · · · ·