Monday, January 18, 2010

OUTPUT Clause in SQL SERVER

The OUTPUT clause gives you the ability to access the inserted and deleted tables that in versions previous to SQL Server 2005 were accessible only through triggers.
Some of Benefits of this clause:
• For auditing actions (Insert statement)
• For data archiving (delete statement)
• To see the old and new modification in the row (update statement)
Let's see this example:



We can also use OUTPUT clause with DELETE and UPDATE statement also.

No comments: