1. function
Deletes a character of the specified length and inserts another set of characters at the specified starting point.
2. Grammar
STUFF (character_expression, start, length, Character_expression2)
3. Explanation
character_expression is the string to be processed;
start is the beginning of the deletion character, the string is starting from 1, if you want to Delete , then start is 2;
length the length of the character to be deleted, such as deleting from the second character, removing three characters, or length 2;
character_expression2 the string you want to use to replace the deleted string (a bit of a mouthful, but not difficult to understand) ;
4, example
such as preprocessed string character_expression is ' abcdef ' and wants to remove ' CDE ', the stuff function is:
stuff (' ABCdef ', 3, 3, ');
If you want to replace ' CDE ' with ' xyz ', the stuff function is
Stuff (' abcdef ', 3,3, ' xyz ');
Use of SQL Server stuff functions