• SoberCounsel (12/18/2012)


    I knew by suggesting it that a few eyebrows would probably be raised!

    Thanks Sean, for adding the links to further info about the nolock hint... as it happens, I was already aware of the issues it can cause (not just dirty reads!), and so I feel I have to highlight that I wasn't suggesting to just chuck it into queries regardless!!

    I do still find that it's a useful hint - for me, it comes in most useful when dealing with large OLTP tables - though familiarity with the actual data being queried is a must, as is awareness of the potential problems with the hint.

    😉

    You might want to take a look at isolation for large OLTP situations. Frequently using snapshot isolation is a better approach than using NOLOCK. It does have a little bit of associated overhead too. Nothing comes free in the database universe. 😛

    http://msdn.microsoft.com/en-us/library/ms173763%28v=sql.105%29.aspx

    _______________________________________________________________

    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/