Ashutosh Arya
Ashutosh Arya

Reputation: 1168

how does NOLOCK works

I know the use of NOLOCK, but can someone please help me with the mechanism of NOLOCK.

  1. if a table is write-locked will no lock return values(during the write-lock).

if yes then which state of data will it refer ?

Upvotes: 0

Views: 142

Answers (1)

Remus Rusanu
Remus Rusanu

Reputation: 294197

Yes, NOLOCK can return locked data. The state of the data returned is not determined (and for almost every claim of 'it will be consistent with...' you can find a counter-example posted by one MVP or another...). NOLOCK reads are not guaranteed to be correct and, in fact, are often incorrect. There is never a good reason to use NOLOCK. You should address the underlying problem, not try to cop out with dirty reads.

Upvotes: 2

Related Questions