Comment on I accidentally removed the WHERE clause from my SQL query in a personal tool. Every row is now the same. I lost everything, have no backup, and I'm stupid.

Jambone@lemmy.world ⁨1⁩ ⁨year⁩ ago

In MSSQL, you can do a BEGIN TRAN before your UPDATE statement.

Then if the number of affected rows is not about what you’d expect, doing a ROLLBACK would undo the changes.

If the number of affected rows did look about right, doing a COMMIT would make the changes permanent.

source
Sort:hotnewtop