• Thom A - Wednesday, March 29, 2017 8:56 AM

    jasona.work - Wednesday, March 29, 2017 8:45 AM

    Um, is it bad if I ran this in production a week ago:
    UPDATE ANNUALSALARY SET SALARY = 'POTATO';

    OH don't get me started on that. Someone was asked to update the name of someone last week, as it had been entered incorrectly. The SQL?
    UPDATE misys_users
    SET surname = 'Lapine';

    Yeah... That took that software off line for good 30 minutes. We were scrambling to work out why no one could login, and they finally piped up 20 minutes later to tell us they may have "made a mistake"... To add insult to injury, Lapine was also not the correct spelling. :pinch:

    HAHA!!! This reminds me of very first job as a dev. I had to update the employee table to change somebody's name. I ran a very similar update statement without a where clause that was supposed to disable one users account but instead disabled the whole table. To pour salt on the wound they had a trigger on that table that checked to see if the account was disabled and if so, it used some sp_OACreate stuff (sql 7) and disable their AD account. I managed to disable the entire company's AD accounts. Close to 5,000 employees nation wide. It was a bit of a nightmare to say the least that took almost two days for the whole IT staff to unravel.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/