In SQL Server, NOLOCK is a very debated keyword. Many developers use it because they think it can quickly remove blocking. But using NOLOCK all the time, without thinking carefully, is not a good idea. It may help for a short time, but it can also cause dirty reads, wrong results, and reports that do not show the real data.
Why Do People Like NOLOCK?
At first, NOLOCK looks useful. Imagine a query that is blocked by another process using locks. If you add NOLOCK, SQL Server may ignore those locks, and the query can run right away. This seems like a good solution. But in reality, the problem is not solved. It is only hidden.
What Is the Real Problem?
When you use NOLOCK or the READ UNCOMMITTED isolation level; SQL Server may let your query read data that is not finished yet. This means:
- Dirty reads: You may read changes that are not committed yet and can still be canceled.
- Unfinished data: You may see values that are still changing.
- Wrong results: Rows may be missed, shown twice, or returned in an unstable state.
- Rare errors: In some cases, you may get errors like Error 601, especially when data pages move during the scan.
Do you really want financial reports, dashboards, or business decisions to use data that may not be correct?
If you only need a rough estimate or a random row for a non-important task, NOLOCK may be okay. But using it as a general rule for all queries is a bad design choice.
A Better Option: Use RCSI
If the real problem is readers being blocked by writers, a better solution is Read Committed Snapshot Isolation (RCSI).
When RCSI is turned on at the database level, SQL Server uses row versions in tempdb. This gives readers a safe and committed view of the data.
In practice, this means:
- Readers do not block writers in the same way.
- Writers do not block readers in the same way.
- Queries using READ COMMITTED can read committed data without waiting for locks.
- On readable secondary replicas in an Availability Group, this kind of read behavior is already normal.
RCSI is not free. It uses some extra space and work in tempdb, so you must monitor it. But for most production systems, this is a better trade-off than using wrong data.
Final Thought
NOLOCK is not always wrong, but many people use it too much and in the wrong places. It can be useful in small, non-critical cases where exact accuracy is not important. But if you care about correct and reliable data, RCSI is usually the better choice.
When you need both performance and concurrency, the best answer is not to ignore locking. The best answer is to use a safe concurrency method that protects both speed and data quality.
Seyed Hamed Vahedi
Wed, 12 August, 2026