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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Dec 10, 2011, 1:44 AM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 10, 2011, 1:49 AM EST
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
Datta KharadRank #2,135 · 668 reputationPosted Dec 10, 2011, 2:02 AM EST
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
Vikas MishraRank #559 · 4.3K reputationPosted Dec 10, 2011, 6:48 PM EST