4
Reply

What is use of NoLock?

Rahul Chavan

Rahul Chavan

Apr 07, 2016
503
0

    There is a situation where have possibility to more then one operation can have on same table or same time will occur in this case microsoft has been introduced Lock and WITH (NOLOCK). when read the record from tables.

    Vinay Kumar Gupta
    August 20, 2017
    0

    There is a situation where have possibility to more then one operation can have on same table or same time will occur in this case microsoft has been introduced Lock and WITH (NOLOCK). when read the record from tables.

    Vinay Kumar Gupta
    August 20, 2017
    0

    WITH (NOLOCK) is the equivalent of using READ UNCOMMITED as a transaction isolation level. So, you stand the risk of reading an uncommitted row that is subsequently rolled back, i.e. data that never made it into the database. So, while it can prevent reads being deadlocked by other operations, it comes with a risk. In a banking application with high transaction rates, it's probably not going to be the right solution to whatever problem you're trying to solve with it IMHO.

    Awadhesh Jha
    August 08, 2017
    0

    If you want to write a query to retrieve the data from table and do not lock the table/ records then we use Nolock.Example-SELECT * FROM Customer WITH (NOLOCK)

    Rahul Chavan
    April 07, 2016
    0