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 is an indexing technique?
What is BCNF? How is it better than 2NF & 3NF?
What are the advantages of partitioning?
how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?
What do you understand by intent locks?
How do I start sql server 2016?
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
What are the types of ssrs?
What is a db view?
Explain transaction server explicit transaction?
What are the advantages of paper records?
What is deploy, process and build? : sql server analysis services, ssas
What kind of problems occurs if we do not implement proper locking strategy?
Can you explain different types of locks in sql server?
What is the difference between a function and a stored procedure?