Hi friends.......
What is a NOLOCK and how we use it?
Thanks.......
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Dec 10, 2011, 6:44 AM
Vikas MishraPosted Dec 10, 2011, 11:48 PM
Datta KharadPosted Dec 10, 2011, 7:02 AM
You can refer these link...
http://blogs.msdn.com/b/davidlean/archive/2009/04/06/sql-server-nolock-hint-other-poor-ideas.aspx
Example:-
http://www.techrepublic.com/article/using-nolock-and-readpast-table-hints-in-sql-server/6185492
Satyapriya NayakPosted Dec 10, 2011, 6:49 AM
Using the NOLOCK query optimiser hint is generally considered good practice in order to improve concurrency on a busy system. When the NOLOCK hint is included in a SELECT statement, no locks are taken when data is read. The result is a Dirty Read, which means that another process could be updating the data at the exact time you are reading it. There are no guarantees that your query will retrieve the most recent data.
The advantage to performance is that your reading of data will not block updates from taking place, and updates will not block your reading of data. SELECT statements take Shared (Read) locks. This means that multiple SELECT statements are allowed simultaneous access, but other processes are blocked from modifying the data. The updates will queue until all the reads have completed, and reads requested after the update will wait for the updates to complete. The result to your system is delay(blocking).
Please refer the below link
http://www.codeproject.com/KB/database/NoLockHintBehaviour.aspx
Thanks