The main idea around the SQL Server function called STUFF is concatenating multiple columns into a single column with more flexibility than the CONCAT function would provide. Besides, STUFF can be combined with other techniques for some interesting effects.

In this article, we’ll explore the possibilities that the STUFF command provides for SQL Database specialists.

The T-SQL STUFF Function

Let’s first take a look at the official Microsoft definition of the STUFF function:

The STUFF function inserts a string into another string. It deletes a specified length of characters in the first string at the start position and then inserts the second string into the first string at the start position.

Thus, when you are using the STUFF command, you are rearranging the column data.

#sql server #sql functions #t-sql #sql

T-SQL Stuff Command on Practical Examples
1.15 GEEK