A common command in the Linux world is the
teeallows you to do is pipe the output of a command to a file as well as the console. This same functionality can be implemented using multiple
OUTPUTclauses in a T-SQL statement. In this example we are going to update a few hundred records. When the update statement is run, not only will it update the MyGuid table but it will update a log table and also return the result of the update. This is accomplished by using two
Check it out. I don’t use OUTPUT that often, but it can be quite useful when in a pinch or if you want to prevent scanning a table twice.