3 ms·
I always (with sql server at least) add a begin tran/commit/rollback before any prod statements, because of getting burned in the past. Even if you add the WHE
by foresterh 15y ago
I always (with sql server at least) add a begin tran/commit/rollback before any prod statements, because of getting burned in the past.
Even if you add the WHERE, but put it on a second line and only run the first, the transaction will help...
Of course, if it's going to lock the data, do all of the statements together:
BEGIN TRAN
UPDATE ... WHERE ...
SELECT ... WHERE .... -- show that the update worked
ROLLBACK
Then run the actual statement