What is NOLOCK Hint in SQL Server ?

Using the NOLOCK query optimizer hint is generally considered good practice to improve concurrency on a busy system especially for Reporting workloads. 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 performance advantage is that your reading of data will not block updates from taking place, and updates will not block your reading of data. SELECT statements generally take Shared (Read) locks which are avoided because of the hints. This means that multiple SELECT statements are allowed simultaneous access, but other processes are blocked from modifying the data.



You May Interest

What is RAISEERROR in SQL Server ?

How is Auditing Different From Change Data Capture in SQL Server?

How to Learn MS SQL Server Version

What is the Difference Between CHAR and VARCHAR Datatypes in SQL ...

How is Change Tracking is Different From Change Data Capture ?