From the BlogSubscribe Now

Preview Inserts, Updates, Deletes, and Merges in SQL Server

With the complex and convoluted database structures out there in the wild in corporate America, often times you run into statements that could scare you half to death. This is especially true when dealing with Inserts, Updates, Deletes and Merges.

Here is a quick and simple way to test the outcome of your changes before actually executing the change.

The important parts are:

BEGIN TRANSACTION – Starts the transaction.

OUTPUT inserted.* – Outputs the result of the change to the results window.

ROLLBACK TRANSACTION – Reverses the effects of the change, leaving the data in the same state it started in.

Speak Your Mind


17 + eight =