What is the STUFF function and how does it differ from the
REPLACE function?
Answer Posted / 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 |
Post New Answer View All Answers
Explain time data type in sal server 2008?
How can we improve performance by using SQL Server profiler?
What is the difference between truncate and delete commands?
What are the different editions available in sql server 2000?
What does COMMIT command do?
What is the difference between dropping a database and taking a database offline?
What are the differences between decimal and float in ms sql server?
Explain having clause?
What the difference between UNION and UNIONALL?
Differentiate between a primary key and a unique key.
What options are available to audit login activity? : sql server security
How to add an address record into adventureworkslt?
How will you add a dimension to cube? : sql server analysis services, ssas
What are the acid properties?
What is inner join? Explain with an example?