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
What happens if null values are involved in comparison operations?
What are the restrictions while creating batches in sql server?
What is SQL Azure?
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
How to provide values to user defined function parameters?
Do you know query execution plan?
What are the differences between char and varchar in ms sql server?
What is abstracting periodical?
How to insert data into an existing table?
What is dynamic cursor in SQL SERVER?
What are the authentication modes in sql server? How can it be changed?
1)what is the difference between Reinitializing a Subscription and synchronization the subscription? 2)when to use reinitializing ? 3)when to use synchronization? 4)when adding table or deleting a table what to do?(reinz.. or syn) 5)when adding a column what to do?
How to find related tables in sql server?
What are the steps you can take to avoid “deadlocks”?
Why use identity in sql server?