205
shigeru
8y

The intern learned a great lesson today...

Comments
  • 3
    No test environment??!
  • 3
    limit one would be a good thing to teach too
  • 17
    This is why I actually write the where clause first, then the rest of the update or delete query.
  • 6
    Wait for him to discover dropping tables. Such fun, backup much.
  • 3
    always start with: "begin tran"

    "commit tran" after you are satisfied.
  • 7
    @DeepSpace same with emails. Writing the body first then the subject
  • 1
    Hopefully that is a one time mistake for the intern. Major lesson learned.
  • 0
    @matchacookie Yea he was local but still
  • 4
    I always write the select statement first, and when I'm happy I remove everything before where and replace with update / delete / whatevs. :)
  • 0
    how does that even happen???
  • 0
    rollback!!!!
  • 0
    always do it in a transaction. I learnt it the hard way.
  • 0
    A Post I read here once Said:

    "I always start my update and delete querida with "LIMIT 1".

    From there on, I always do that too, and if not necessary I remove after writing the full statement.
  • 0
    @freeridet I altered up the SSMS default templates to start with BEGIN TRAN and end with ROLLBACK. I only change it to COMMIT when I'm sure it's good. This has saved me many times from stupid mistakes, even long after I was no longer a beginner.
Add Comment