Question
What is difference between STUFF and REPLACE in SQL Server?Answer
REPLACE is used to replace all the occurances of the given pattern in a string.Example: select Replace('Nirav','N','R')
O/P: Rirav
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
No comments:
Post a Comment