DEV Community

Discussion on: 👻 Do you have any horror stories to share? Spooky bugs, scary data leaks, horrifying code, etc. 🎃

Collapse
 
andreujuanc profile image
Juan C. Andreu • Edited

One time a friend of mine and colleague was "fixing" some purchase orders and he had to delete some of the rows. He opened Management Studio and got some queries running.

After confirming the rows he needed to delete, he started to write the DELETE query. He always commented the delete statements to prevent any accidental data loss, but that night right after when he has just written the table name part of the syntax, he accidentally pressed F5 because he wanted to be sure that the SELECT conditions were correct.

Something like this:

SELECT .. 
FROM [TABLE HERE]
WHERE [LOTS OF CONDITIONS ]

DELETE FROM [SAME TABLE NAME HERE] 
[HE FORGOT TO PLACE THE CONDITIONS HERE]

The best part was when he pressed STOP to stop the query and the cancel was not working, he panicked and unplugged the Ethernet cable from his computer. xD

To this day, some people say that some of those lost rows still appear on query results.