How to Fix SQL Server Error 8974 (Msg 8974)

Published
Length
3 min read

Luis Felipe Dias

All posts

You get sql server error 8974 when an off-row data node has broken page links. You fix it by restoring a clean backup or rebuilding the broken index. This failure is a severity 16 table error in the database engine. It points to an object ID, index ID, partition ID, and allocation unit ID. When large values do not fit on a standard data page, the engine moves them. It puts them on off-row pages and links those pages together. If a pointer in that chain breaks, the engine raises message 8974.

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 get sql server error 8974 when an off-row data node has broken page links. You fix it by restoring a clean backup or rebuilding the broken index.

This failure is a severity 16 table error in the database engine. It points to an object ID, index ID, partition ID, and allocation unit ID. When large values do not fit on a standard data page, the engine moves them. It puts them on off-row pages and links those pages together. If a pointer in that chain breaks, the engine raises message 8974.

What causes sql server error 8974 in the database engine

Disk sub-system failures are the main root cause of this page corruption. When a storage controller drops a write or corrupts a sector, page headers break. Faulty memory chips can also corrupt pages before the engine writes them to disk.

The error message reports the exact object ID and index ID with the bad node. It also lists the partition ID and allocation unit ID for the table. Off-row nodes hold text, binary data, or big variable-length columns. Because these nodes link back to base records, a single bad page breaks queries. Any app reading that specific row will fail right away.

Hardware drivers and firmware bugs often hide behind these storage errors. Before you touch the database, ask your system team to check the disk logs. Fixing the table on a failing disk will only cause more lost pages.

How to diagnose and fix the failure in production

Start by checking the error log to find the exact object ID and index ID. Next, run a consistency check on the database to see the full scope of damage. Do not run repair options that allow data loss during your first check.

The safest fix is a page-level or full restore from a known clean backup. If you have valid transaction log backups, you can roll forward to the current point. This brings back the off-row data node without losing any user rows.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Look at the index ID reported in the error message. If the damage is only in a non-clustered index, you can drop and recreate it. Rebuilding the index builds fresh pages from the base table. If the base table itself is corrupt and you lack a backup, export the good rows. Copy them to a new table and replace the broken one.

How to keep least-privilege access during recovery

During an outage, teams often grant broad permissions to speed up repairs. Avoid giving every responder the db_owner role just to check table rows. Members of db_owner can run all maintenance tasks and can even drop the database.

Keep duties split between responders who inspect data and admins who run repairs. A database user is the identity of a login when it connects to a database. For people who need access to many databases, a SQL user with a login is common. For access to one or a few databases, a contained database user is an option. An admin must first turn on contained databases on the server and database.

Give read-only responders the db_datareader fixed role so they can read all user tables. You cannot change the permissions assigned to fixed database roles. If an account must never read table data, use the db_denydatareader role. If an account must never change data during recovery, assign the db_denydatawriter role. When responders inspect user tables, masking rewrites matched fields like emails, phone numbers, and card numbers in results.

Check SQL Server batches and results on the wire

SQL Server logins and roles decide who connects. They do not check what each TDS batch does or mask sensitive values in returned rows. With hoop.dev, you run an open-source proxy, a sidecar for your SQL Server, inline in the TDS wire protocol. On every batch an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Before a batch hits the server, hoop.dev guardrails refuse disallowed actions with a native TDS error or hold risky statements for approval. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns in memory, and every decision is logged. Explore the MIT-licensed project on GitHub.

Frequently asked questions

What does severity 16 mean for sql server error 8974?

Severity 16 means the error comes from a problem that the user or admin can address. For message 8974, it flags a broken off-row data node in a specific table or index.

Can I fix message 8974 without losing table data?

Yes, you can restore the affected pages or the full database from a clean backup. If the error is in a non-clustered index, rebuilding that index also fixes it without data loss.

Which role should engineers use to verify table rows after a fix?

Assign the db_datareader role so engineers can read user tables and views without changing data. Avoid using db_owner for simple checks because that role can drop the database.

The query runs. The emails stay hidden.