String Functions – STUFF()

I am going to continue my series of very short articles or tidbits on Transaction SQL string functions. I will exploring the STUFF() function today. The STUFF() function takes a source string [S], a starting position [P], a total length [L] and a replacement string [R] as input parameters. It removes [L] characters from the source string [S] starting at position [P] and replaces those changes with string [R]. From the definition of this function, one could easily write a custom user defined function with the same functionality using the…