I have used other SQL tools and some allow me to see the output of a threatening query before committing. I like this two step process (so I can double check I’m not doing something bad).
Is there a way in SQL Server 2008 R2 to “execute” a query, see the output for the affected rows, and then choose to accept or throw away the commit?
EDIT:
I also found another question asking the same with a different answer using the OUTPUT clause.
Yes this is possible. You can either use the session option
SET IMPLICIT_TRANSACTIONS ONor create an explicit transaction as below.However you should be aware that your open transaction will hold locks until the transaction completes which may block other transactions so this should be used with caution in any multi user environment.