Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk2 min

An Index Does Not Make SQL Server NOLOCK Safe

SQL Server’s NOLOCK hint remains vulnerable to dirty and inconsistent reads even when a query uses an index. Here’s what it changes, what it does not, and which alternatives to assess.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

No. Using an index does not make SQL Server’s NOLOCK hint safe. NOLOCK has the same read behavior as READUNCOMMITTED: it can expose uncommitted changes and return an inconsistent result. An index affects how SQL Server accesses data; it does not change the hint’s isolation behavior.

What an index changes—and what NOLOCK changes

An index is an access path: it can help SQL Server find rows, and an INDEX table hint can direct the optimizer to use specified indexes. NOLOCK, by contrast, controls whether shared data locks protect the read. These are separate behaviors, so forcing or using an index does not make a NOLOCK query consistent. Microsoft documents the distinct hint behaviors in its table hints reference.

As an Amazon Associate I earn from qualifying purchases.

What can go wrong with NOLOCK?

Dirty reads

A query can read changes made by a transaction that has not committed. If that transaction later rolls back, the query may have returned data that never became committed database state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Rows can be duplicated or missed

Microsoft also warns that a READUNCOMMITTED or NOLOCK query can see records twice or fail to see records at all. An index does not eliminate these risks; they follow from the read behavior, not from whether the query uses an index.

A scan can fail during data movement

SQL Server documents error 601 with the message, “Could not continue scan with NOLOCK due to data movement.” Microsoft’s error 601 guidance advises retrying the operation or removing the hint, and identifies READ COMMITTED or SNAPSHOT as alternatives. This is a documented possible failure, not a claim that every NOLOCK scan fails.

NOLOCK does not prevent every kind of blocking

NOLOCK can avoid waits caused by shared data locks, but it does not mean the query never blocks. Queries using the hint still acquire schema-stability (Sch-S) locks during compilation and execution. A concurrent schema-modification (Sch-M) lock can block them. Microsoft describes this behavior in its table hints documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Alternatives when you need fewer reader-writer waits without dirty reads

If the goal is to reduce locking contention while avoiding dirty reads, Microsoft documents READ COMMITTED with READ_COMMITTED_SNAPSHOT enabled, and SNAPSHOT isolation, as options to consider. Both use row versioning for reads rather than permitting dirty reads. The appropriate choice depends on the database’s configuration and the application’s transaction requirements; check the target SQL Server version and settings before changing behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Option Dirty reads Read behavior Scope to evaluate
NOLOCK / READUNCOMMITTED Permitted Reads without shared data locks protecting against concurrent changes; results can be inconsistent. Table hint on the query.
READ COMMITTED with READ_COMMITTED_SNAPSHOT enabled Not permitted Uses row versioning for reads when the database option is enabled. Database configuration and READ COMMITTED behavior; verify existing settings.
SNAPSHOT Not permitted Uses row versioning under SNAPSHOT transaction isolation. Transaction isolation and database configuration; verify application transaction needs.

For implementation details and the behavior of isolation levels, consult Microsoft’s SET TRANSACTION ISOLATION LEVEL reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.