Explain about SQL Stuff()..

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

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.

Example:

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