The result from the OUTPUT clause can be inserted into a separate table during the execution of the query.This clause is most commonly used for audit purpose.
The following example updates rows in the table Sales. The table alias is created and assigned to “S” in the FROM clause.
The alias is also specified as the target object in the UPDATE clause. In order to do that, we’ll need to use the WHERE clause.
In order to limit the number of rows, we’ll need to set up a where clause.
The condition is defined in the where clause that identifies what rows to modify in the table.
I hope you enjoyed reading this article and for any questions, please feel to comment below…