Explain about SQL Stuff()..

 Posted by Bharathi Cherukuri on 7/24/2012 | Category: Sql Server Interview questions | Views: 1013 | Points: 40

By deleting a specified number of characters from 1st string expression and replacing them with 2nd string expression, a string will be formed.
This SQL Stuff() function is used to return the newly formed string.
Important note is that, for deletion purpose, you have to specify the starting position and the length of the string.


SELECT STUFF('1234567',2, 3, '999');

It will display the result as: 1999567

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response