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 mixed authentication mode of sql server?
How to start sql server browser service?
How to add the custom code in Report?
What is field in algebra?
Explain syntax for viewing, dropping and disabling triggers?
Why SQL Agent is used?
Explain relational data?
Why use stored procedures in sql server?
Explain tables in SQL Azure?
What is the use of commit?
What is service broker? : sql server database administration
Explain important index characteristics?
where can you add custom error messages to sql server? : Sql server administration
What is nonclustered index on computed columns?
what is raid and what are different types of raid configurations? : Sql server database administration