Open almost any SQL Server codebase and you'll find it on every table:
SELECT o.OrderID, c.Name
FROM dbo.Orders AS o WITH (NOLOCK)
JOIN dbo.Customers AS c WITH (NOLOCK) ON c.CustomerID = o.CustomerID;
Someone added it years ago because "it makes queries faster and stops blocking". Should you use it? Almost never, and there's a better fix for the problem it was meant to solve.
What NOLOCK actually does
WITH (NOLOCK) is the same as READ UNCOMMITTED for that table. The query doesn't take shared locks while reading and ignores other sessions' exclusive locks. That's why it doesn't wait on blocked rows.
People usually know it can return dirty reads: data from transactions that later roll back. That's the smallest problem. The others are worse:
1. Missing rows. A NOLOCK scan can read pages in allocation order. If another session splits a page or moves rows during the scan, rows can move behind the scan's position and never be read.
2. Duplicate rows. The same movement can put a row ahead of the scan, so it's read twice. Your SUM of order totals can be larger than the real total.
3. Inconsistent rows. A row can be read halfway through an update to a large or off-row value.
4. Errors. Under heavy concurrent change you can get:
Msg 601: Could not continue scan with NOLOCK due to data movement.
None of this shows up in testing. It happens under production concurrency, in the reports people trust the most.
It isn't lock-free either
NOLOCK queries still take schema stability (Sch-S) locks. They're blocked by, and they block, schema changes, index rebuilds and partition switches. "Never blocks" isn't true.
