Deleting rows in a SQL database can sometimes be a nerve-racking experience. What if you’re deleting the wrong rows? Or what if the business later tells you they want their data back?
Fortunately SQL Server provides us with an easy way to essentially “back up” any rows affected by a DELETE
operation to a table.
This article looks at using the OUTPUT ... INTO
clause to save a copy of deleted rows to another table.