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


Please Help Members By Posting Answers For Below Questions

What is the difference between lock, block and deadlock? : sql server database administration

573


what are different types of raid configurations? : Sql server database administration

490


What is the recursive stored procedure in sql server?

528


What are the differences between local and global temporary tables?

562


Explain the difference between control flow and data flow?

532






mention different types of relationships in the dbms?

509


How can you check the version of sql server?

565


What is triggers and stored procedures?

519


how to restart sql server in single user mode? How to start sql server in minimal configuration mode? : Sql server database administration

467


what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?

5506


hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.

2474


How to remove duplicate rows from table?

606


Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...

1577


How to restore performance issues and how to check?

1528


How to make a column nullable?

605