News for hackers. Stuff that matters.
Re:An administrator accidentally deleted the production data... by spacecowboy_lon on Wednesday March 23, 2016 @08:08AM (#11343668)
I tend to write my DELETE statements by writing a SELECT first then edit that into the delete version
Re:An administrator accidentally deleted the production data... by cwilkes on Wednesday March 23, 2016 @10:19AM (#11344664)
I've turned to creating a temp table and putting the primary keys from the select statement into there so I can guard myself against the thing that was to delete a handful of rows deleting everything. Plus with that you can do another join and see if those rows have some sort of value in it that you didn't expect.
Re:An administrator accidentally deleted the production data... by sixothree on Wednesday March 23, 2016 @05:03PM (#11348216)
I also put my DELETE statement on a line by itself and comment out the line. In SQL Server execution processes only the selected text. So I select starting with DELETE then run.
Re:An administrator accidentally deleted the production data... by danieltillett on Wednesday March 23, 2016 @08:39AM (#11343856)
This is exactly what I do too.