Jambone@lemmy.worldtoProgramming@programming.dev•I accidentally removed the WHERE clause from my SQL query in a personal tool. Every row is now the same. I overwrote 206,000+ rows. I have no backup, I am stupid.
12·
1 year agoIn 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.
Nice to see the KLR reference!