|
|
|
|
|
by bartread
2477 days ago
|
|
The trick is to execute a BEGIN TRANSACTION, then do whatever you need to, then verify that you've done everything correctly (consider doing this twice). Then, only when you're absolutely certain all is as it should be, do you execute a COMMIT TRANSACTION. All of this is predicated on the idea that you know exactly what changes you need to make, exactly what state the database should be in afterwards, exactly how to verify this, and also how to check for unintended side-effects. I suppose the real trick is to avoid having to do this kind of thing in the first place but, as well all know, sometimes that's just not possible. |
|