• Jack Corbett (7/31/2015)


    Cadavre (7/31/2015)


    Brandie Tarvin (7/30/2015)


    Why oh why oh why do people insist on using WITH (NOLOCK) instead of doing things like setting transaction isolation levels or fixing indexes to resolve performance issues?

    Work thing. I've been trying to stamp out WITH (NOLOCK) use and now because things "aren't working" one group is trying to throw it back in.

    ARGH!

    Well, this is my battle for the week.

    EDIT: Seriously, can anyone give me a real reason why WITH (NOLOCK) might be functionally necessary for production code?

    In our continuous integration server (TeamCity), one of the configurations installs our database. It then fires a "Validation Tool" that I wrote against the installed database and produces a report. One of the tests is to check for NOLOCK, if it is found then it fails the build and sets off the siren of shame[/url] and sends an e-mail to the person that caused the issue. I thoroughly recommend doing something similar for your own development environment.

    Not an expert but I think you could do this with Policy Based Management. It would be nice if this check got added in the Code Analysis rules in SSDT database projects as well.

    I think PBM doesn't handle this well, nor add exceptions. tSQLt would also do this, though if you have something, not sure this needs to be changed.