Stuff function in SQL Server

Madhu.b.rokkam
Posted by Madhu.b.rokkam under Sql Server category on | Points: 40 | Views : 2931
Select Stuff('Muthu Babu', 1, 3, 'Mad')


Returns
Madhu Babu

Stuff function stuffs the given string at the specified location.
In the above sample Mad is stuffed from 1 to 3 position of Muthu Babu
This makes it to stuff Mad in place of Mut so the result becomes
Madhu Babu.

Similarly

Select Stuff('Muthu Babu', 1, 1, 'Mad')


Returns
Maduthu Babu

Hope this helps.

Comments or Responses

Login to post response