Skip to main content

Test a SQL query that modifies data (manually) and inspect the command output before committing the transaction.

begin tran;

update YourTable set foo = 1;

/*---------------------------------------------
To Review Changes can use OUTPUT clause here...
---------------------------------------------*/

--output INSERTED.*, DELETED.*
--where bar = 2;

/*-------------------------------
... or a SELECT against the table
-------------------------------*/

select *
from YourTable
where bar = 2;

-- Execute...
-- commit tran;
-- or
-- rollback tran;
-- ... when ready