Breaking News
Loading...
Wednesday 24 August 2016

STUFF function in MS SQL

STUFF function in MS SQL is use to replace the specific potion of this with another string in any sentence. 

Syntax: STUFF(“String_Value”,Start_Position,Length,”New_String_Value”);

Here in STUFF function you have to pass original string as first parameter (means string on which you have to apply STUFF function), then second parameter you have to pass start position (index) means from where you want to start the replacement, and the in third parameter you have to pass how many character you have to replace, and the last parameter you have to pass new string which you want to add in original string.

Example:
Select STUFF('This is STUFF Function in MS SQL',15,8,'Method')
 
OUTPUT:
This is STUFF Method in MS SQL

0 comments:

Post a Comment

Thanks for comment

 
Toggle Footer