What is the STUFF function and how does it differ from the
REPLACE function?
Answers were Sorted based on User's Feedback
Answer / abhaymalviya
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 ? | 37 Yes | 1 No |
Answer / 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 |
Does table partitioning improve performance?
Is truncate a dml command?
Can we perform backup restore operation on tempdb? : sql server database administration
When to use Inner join & when to use subquery?
What is the difference between DTS and SSIS?
Can group by be used without aggregate functions?
What happens if you delete a table that is used by a view?
Can you get second highest salary from the table?
When do you use SQL Profiler?
In the primary key have a multiple field or not?
How to find Duplicate Records In table?
what is meant by sql injection with example and one more question how to catch the errors in sqlserver