Ran update query on 1m+ record without where clause. Thank god I missed the commit command or else today would have been my last day.

  • 5
    You’re not a real DBA unless you commit that transaction 😏
  • 3
    We’ve all been there πŸ˜‚
  • 0
    One lucky dev lol
  • 0
    I'm just going to assume you have backups and leave it there πŸ˜…
  • 10
    Friendly tip, as soon as you write "update", write the "where" BEFORE the table name, so that if you commit/execute it partway, it will just fail because of a syntax error instead of wiping a table.
  • 1
    @Fradow That's nice idea
  • 4
    What commit... We always use in real time. One you got GO there no going back
  • 11
    I've shared one rant before similar to this. In that case instead of me my boss did that for "password" column and in the midnight I had to send all users an email stating due to security reason we have reset your password.
  • 0
    More chances, don't miss it next time😈😈😈
  • 2
    @AnonymousDev that is genius :D
  • 2
    @billgates is that why people often seem to like MySQL/MariaDB over MS SQL Server? :P
  • 1
    @Condor well if you want to get technical... MS SQL supports it too like most DBs. I believe its called transactions

    Or the feature can be just an option on the SQL Client, like Production mode. Basically like a confirmation box.
  • 1
    @billgates I have barely any experience with databases, much less MS SQL.. so please, no :')
    Interesting to learn about this though!
Add Comment