• Kannan Vignesh (12/28/2014)


    Nolock doesn't allows to table get lock.

    It was a rhetorical question to mostly suggest that it shouldn't be used in most cases. WITH(NOLOCK) is actually the proper form because the form without the WITH has been deprecated. It can also cause some major issues. For example, it is possible to return two rows for the same thing... one prior to an update and the dirty read after the update. It's not as uncommon as people would think and many folks have written demonstrable code on the subject. Since it's not likely that a SELECT will be interfered with on the underlying tables that the INFORMATION_SCHEMA views rely on, you might just want to leave it off to prevent the eventual duplication of rows from occurring.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)