Link: https://www.brentozar.com/archive/2018/10/using-nolock-heres-how-youll-get-the-wrong-query-results/
The article mentions some problems with using NOLOCK:
- You can see rows twice
- You can skip rows altogether
- You can see data that was never committed
- Your query can outright fail with an error, “could not continue scan with nolock due to data movement”
Then a fix is mentioned as:
> Create an index on the table (any single-field index would have worked
> fine in this particular example, giving SQL Server a narrower copy of
> the table to scan)
How does creating an index help with NOLOCK problems?
Asked by variable
(3590 rep)
Mar 1, 2022, 05:34 AM
Last activity: Mar 1, 2022, 04:37 PM
Last activity: Mar 1, 2022, 04:37 PM