The STUFF function inserts a set of characters into a given string at a given position
STUFF(character_expression1, start, length, character_expression2)
Character_Expression1 represents the string in which the stuff is to be applied. start indicates the starting position of the character in character_expression1, length is the length of characters which need to be replaced. character_expression2 is the string that will be replaced to the start position
1) SELECT STUFF('Fun', 1, 0, '*')
the output will be : *Fun.
2) SELECT STUFF('SQL SERVER is USEFUL',5,6,'DATABASE')
the output will be : SQL DATABASE is USEFUL
Post Reference: Vikram Aristocratic Elfin Share
No comments:
Post a Comment