📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Why is NOLOCK dangerous in SQL Server, and what should you use instead?

Mid-Level Theory Intermediate isolation-levels nolock rcsi sql-server transactions

🎯 Key points

  • Read uncommitted: dirty reads
  • Missing or duplicate rows during page splits
  • Error 601 data movement
  • RCSI for non-blocking consistent reads
  • RCSI is on by default in Azure SQL Database
  • Fix long-running write transactions instead

⏱ 30-second answer

NOLOCK is read uncommitted: it reads rows other transactions haven't committed (which may be rolled back), and because it can use allocation-order scans without shared locks, it can skip rows or read them twice when pages split during the scan. It can even fail with error 601. It removes blocking by giving up correctness. Use read committed snapshot isolation (RCSI), the default in Azure SQL Database, so readers see the last committed version without blocking writers, and fix the long write transactions that cause blocking.

🔍 What the interviewer is checking

Checks precise understanding of read uncommitted anomalies and RCSI.

↩ Usually asked after

More in SQL Features

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me