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
What are some of the pros and cons of not dropping the sql server builtinadministrators group? : sql server security
What is store procedure? How do they work? When do you use?
What are the filtered indexes?
Why is normalisation important?
What is openrowset sql server?
How to use linked server?
What do you understand by physical_only option in dbcc checkdb?
Can we use having clause without group by?
What is named query? : sql server analysis services, ssas
What is normalization 1nf 2nf 3nf?
How to use transact-sql statements to access the database engine?
Is resultset an interface?
How to insert new line characters into strings?
Tell me extended events in sql server 2008?
What is partition in sql server?