Friday, 22 April 2016

Difference between Replace Function and Stuff function in SQL server ?

Replace:
  • Replace function will replace all exact occurrence of the string in a character expression. 
  • Replace function will take 3 parameters as input.
Stuff: 
  • Stuff function will replace only the exact occurrence of the string in a character expression based on the start and length values.
  • Stuff function will take 4 parameters as input.
The above points are the major difference between Replace and stuff function.
If you want to replace all the string occurrence then prefer replace function ,if not so then go with stuff function.

No comments:

Post a Comment