How to Fix SQL Server Error 601 (Msg 601)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see sql server error 601 when a dirty read scan hits moved data. You fix it by retrying the query or removing uncommited read hints. The database engine returns message 601 at severity level 12. It states that it could not continue a scan with NOLOCK due to data movement. Because severity 12 is not a fatal system crash, the server stays online. Still, the active query stops right away and returns no further rows. What causes sql server error 601 in the engine This failure occurs when two

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You see sql server error 601 when a dirty read scan hits moved data. You fix it by retrying the query or removing uncommited read hints.

The database engine returns message 601 at severity level 12. It states that it could not continue a scan with NOLOCK due to data movement. Because severity 12 is not a fatal system crash, the server stays online. Still, the active query stops right away and returns no further rows.

What causes sql server error 601 in the engine

This failure occurs when two sessions touch the same data pages at once. One session reads a table using the NOLOCK hint or read uncommitted level. This tells the engine to skip shared locks and read pages right away. At the same time, a second session changes or deletes rows on those pages.

When an update or delete changes the table structure, pages split or shrink. The engine moves rows to a new page or removes the page completely. The reading session does not hold locks, so it cannot block this move. When the scan reaches the altered page, the pointer is no longer valid. The engine stops the query and throws message 601 to prevent corrupt results.

Heavy write traffic makes this error much more common in busy systems. Index rebuilds, large batch deletes, and frequent key updates cause rapid page movement. Reporting jobs that use dirty reads during peak write hours will fail often.

How to diagnose and fix message 601 in production

First, find which app or user session runs the failing read query. Check your app error logs to match the time of the failure. Look at the query text to see if it uses table hints. Many teams add dirty read hints to speed up slow reports.

The safest fix is to remove the NOLOCK hint from the query. Without this hint, the engine uses its standard locking rules to protect scans. If readers and writers block each other, consider row versioning at the database level. Row versioning keeps old row copies in temp storage so readers do not block. This stops data movement errors without needing dirty reads.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

If you must keep dirty reads, add retry logic in the app code. Since severity 12 errors only stop the current command, the keeps the session active open. The app can catch error 601, wait a brief moment, and run again. Also, schedule big index tasks and batch deletes during quiet hours.

Keeping database roles safe during a fix

When engineers investigate error 601, they often ask for broad database permissions. Do not grant the fixed owner role just to debug a failing scan. Members of the owner role can change settings and even drop the database. Note that you cannot change the permissions assigned to fixed database roles.

Instead, give the engineer a basic read role for their check. Members of the fixed datareader role can read all user tables and views. They cannot add, change, or delete data unless they have the datawriter role. Every role, including the public role, already has the base permission to connect.

Keep your user setup clean as well. A database user is the identity of a login inside a database. For someone checking many databases, a standard user tied to a master login works well. For a single database, an admin can enable contained users with a password. While the engineer runs test reads, data masking can rewrite emails and card numbers in results.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

Does SQL Server error 601 mean my database is corrupt?

No, error 601 does not mean you have disk or table corruption. It only means a dirty read lost its place when another query moved data.

Can a read-only user trigger message 601?

Yes, a user with only datareader rights can trigger this error. If their query uses dirty reads while another user writes data, the scan fails.

Will retrying the query fix error 601?

Yes, running the query again usually works once the page move finishes. Adding a short retry loop in your app is a common quick fix.

The query runs. The emails stay hidden.