What is the STUFF function and how does it differ from the
REPLACE function?
Answer Posted / ruchi
STUFF - Delete a specified length of characters and insert
another set of characters at a specified starting point.
For example: SELECT STUFF('asdfghjkl', 3, 5, 'XYZ')
Go
here the result set is:
asXYZkl
REPLACE - Replace all occurrences of the second given string
expression in the first string expression with a third
expression.
For Example: SELECT REPLACE('Abhay', 'a', 'KKT')
Here the result set is:
KKTbhKKTy
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
Explain how to maintain a fill factor in existing indexes?
How to sort query output in descending order in ms sql server?
What is sql server replication? : sql server replication
Describe in brief system database.
Explain what is the main purpose of having conversation group?
How to update multiple rows with one update statement in ms sql server?
What is the latest version of microsoft sql server?
What are the disadvantages of indexes?
How to create view in stored procedure sql server?
What does sql server mean?
What is difference between count (*) and count 1?
Differentiate sql server reporting services vs. Crystal reports?
What are .mdf files?
What is policy management?
What is use of except clause? How does it differ from not in clause?