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 ms sql server reporting services vs crystal reports?
Give the query of getting last two records from the table in SQL SERVER?
define and explain the differences between clustered and non-clustered indexes.
How to create new tables with "select ... Into" statements in ms sql server?
Define tempdb database?
How you provide security to cube? : sql server analysis services, ssas
Difference between connected and disconnected database in .net with sql server?
Why use “nolock” in sql server?
Explain the stored procedure?
What is db stored procedure?
I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?
Give an example of why you would want to denormalize a database
Can you insert NULL in unique column?
What are the restrictions applicable while creating views? : SQL Server Architecture
What is importing utility?