How to Fix SQL Server Error 7984 (Msg 7984)

Published
Length
3 min read

Luis Felipe Dias

All posts

You see sql server error 7984 when a system table has a bad page type. To fix it, you must restore your data from a clean backup file. This error stops your check statement right away because the engine cannot fix the page. It carries a severity level of 16 and points to a specific object ID. Below, we cover why this error happens and how to recover your data. What causes sql server error 7984 The database engine runs system table pre-checks before it checks user tables. During this step, th

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 7984 when a system table has a bad page type. To fix it, you must restore your data from a clean backup file.

This error stops your check statement right away because the engine cannot fix the page. It carries a severity level of 16 and points to a specific object ID. Below, we cover why this error happens and how to recover your data.

What causes sql server error 7984

The database engine runs system table pre-checks before it checks user tables. During this step, the engine reads every page that belongs to your system tables. Each page in a database file has a header with a page type number. That number tells the engine if the page holds data, an index, or space maps.

When a page in a system table shows the wrong page type, the check fails. The engine logs message 7984 with the object ID and the page ID. It also stops the check statement because this damage cannot be repaired in place. System tables store metadata about all your tables, views, and roles.

Disk drives, storage controllers, or bad memory often cause this page corruption. When storage drops a write or flips bits, a page header gets damaged. A sudden power loss or a forced server reboot can also leave pages torn. Once a system table page breaks, the engine cannot trust the database metadata.

How to diagnose and fix the failure in production

Start by reading the full error log to find the object ID and page ID. Record those two numbers so you know which system table and file failed. Next, check your operating system logs and storage alerts for disk or memory errors. Do not try to fix the database on a disk that is still failing.

Because the check statement ends due to unrepairable damage, automated repair options will not work. Your safest path is to restore the database from a known good backup. If you have a healthy secondary replica, you can fail over to that server. Test your backup on a separate server first to make sure it is clean.

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 lack a clean backup, you must copy the readable user data out. Create a brand new database on healthy storage to hold your salvaged records. Then read the intact user tables and write those rows into the new database. Some tables may fail to read if their metadata lived on the broken page.

Managing permissions during database recovery

During an outage, teams often grant broad permissions to speed up recovery work. For example, members of the db_owner role can run all maintenance tasks. Still, a db_owner member can also drop the entire database by mistake. You cannot change the permissions assigned to fixed database roles in the engine.

Keep permissions tight while your team checks what data is still readable. A database user is the identity of a login when it connects to a database. Give responders a role that matches their exact job during the incident. Members of db_datareader can read all data from all user tables and views.

Using a read-only role lets engineers inspect tables without risking new write damage. If you must block writes for a user, the db_denydatawriter role stops data changes. If you only need access to one database, a contained database user is an option. An admin must first enable contained databases on the server and the database.

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

Can built-in repair commands fix error 7984?

No, built-in repair commands cannot fix this error. The check statement stops right away because system table page errors are not repairable. You must restore from a backup or copy your data to a new database.

What does severity 16 mean for message 7984?

Severity 16 means the error affects a specific database object and requires user action. Even though severity 16 often marks user errors, here it flags broken system metadata. You should treat it as a serious storage failure and act right away.

How can I prevent system table page corruption?

Run regular database checks so you catch bad pages before they spread to backups. Use reliable storage hardware and check your system logs for disk warnings every week. Always test your database backups by restoring them on a separate test server.

The query runs. The emails stay hidden.