In this post explains how to use the STUFF function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the STUFF function deletes a sequence of characters from a source string and then inserts another sequence of characters into the source string, starting at a specified position.
The syntax for the STUFF function in SQL Server (Transact-SQL) is:
The source string to modify.
The position in the source_string to delete length characters and then insert add_string.
The number of characters to delete from source_string.
The sequence of characters to insert into the source_string at the start position.
The STUFF function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server STUFF function examples and explore how to use the STUFF function in SQL Server (Transact-SQL).
For example: