Include BEGIN TRANSACTION with "Execute Current Statement" (Shift-F5)
While using Shift-F5 to execute the current statement, any BEGIN TRANSACTIONS above your UPDATE are ignored, running it not in a transaction.
I shouldn't use Shift-F5 probably, but it's becoming a habit and could be very expensive when forgetting to highlight-execute.
2
votes
Anonymous
shared this idea
-
Brian Cunningham commented
While this feature sounds neat, until then perhaps consider "SET IMPLICT_TRANSACTIONS". In SSMS it is here: Tools | Options, Query Execution, SQL Server, ANSI.
It may be overkill, but to me it is better than forgetting a transaction. Now I just forget to commit, which I find much less dangerous.