(no title)
JeffRosenberg | 4 years ago
BEGIN TRAN;
-- TODO: update statement
ROLLBACK;
Usually I'll run it with the ROLLBACK first, to confirm that it impacts the number of rows I'd expect, and only then change my ROLLBACK to a COMMIT.
stuartd|4 years ago
And yes, before that I had run an UPDATE without a WHERE in production..
eyelidlessness|4 years ago
Instead I do my dry run queries with a read only user and I select the affected data, often using CTEs (or temp tables where performance is an issue) to model any intermediate state. I don’t ever run any writes of this kind without review, backups, and automation.
XCSme|4 years ago
tehlike|4 years ago
Run code first, throw an error to force rollback the transaction...