Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

SQL Server Error 1122: Fix a Failed Page Test

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

SQL Server error 1122 ("Table error: Object ID …, index ID …, page … test failed. Address 0x…") means the storage engine read a page from a data file and its internal checksum or torn-page protection did not match what the page should contain. It is almost always a sign of corruption at the storage layer, not a bug in your query. The practical fix is to stop writing to the affected database, identify the scope of the damage with DBCC CHECKDB, restore from a known-good backup or repair from a secondary replica if you have one, and then investigate the disk subsystem that caused it. Do not run a repair option before you have a restorable backup.

What You'll Need

  • Membership in the sysadmin fixed server role (or equivalent permissions to run DBCC CHECKDB and restore databases).
  • A recent, verified backup of the affected database, plus any log backups needed to reach a point in time.
  • Maintenance window access, because a full check and a restore both lock users out.
  • Access to the Windows Event Log and the SQL Server error log on the host, and to your storage or hypervisor console.
  • Optionally, a secondary replica or log shipping copy if the database is part of an availability group.

Step-by-Step

  1. Capture the exact error text. Copy the full 1122 message from the SQL Server error log or the application that hit it. The message names the database, file, page ID and the hexadecimal address. That address is a memory reference, not a disk location — it tells a support engineer where the check failed, so keep it for your ticket but do not try to interpret it as a file offset.
  2. Reduce writes to the database. If the database is in production, put it in single-user mode or take the application offline so new transactions do not overwrite pages you may need to recover. Note that taking a database offline or dropping it is destructive to availability; coordinate with the application owner first.
  3. Check the SQL Server error log for companion messages. Look for 823, 824, 825 or 605 errors around the same time. Error 825 (read-retry succeeded) is good news — it suggests a transient I/O problem. Errors 823 and 824 point at the operating system or disk layer and should be raised with your storage team.
  4. Run a consistency check. Connect with SQL Server Management Studio or sqlcmd and run DBCC CHECKDB (N'YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; on the affected database. Read the output carefully: it lists every corrupt page and, at the end, suggests repair levels. Save the output to a file for your records.
  5. Decide between restore and repair. A restore from backup is the only method that guarantees a clean database. Repair (REPAIR_ALLOW_DATA_LOSS) can remove pages and leave you with missing rows, and it cannot fix index-level corruption cleanly. If the database is part of an availability group, remove the suspect replica, reseed it from a healthy secondary, and run DBCC CHECKDB on the primary.
  6. Restore from backup if you must. Take a tail-log backup if the database is still online and you need point-in-time recovery, then restore the last full backup, the differential if you use them, and the log backups in sequence, finishing with WITH RECOVERY. Warn users: everything written after the backup is lost unless the tail-log backup succeeded.
  7. If no clean backup exists, run repair as a last resort. Put the database in single-user mode, then run DBCC CHECKDB (N'YourDatabaseName', REPAIR_REBUILD) first — it fixes nonclustered index corruption without data loss. Only if that fails, and only after a file copy of the database and log files, run REPAIR_ALLOW_DATA_LOSS. Re-run DBCC CHECKDB afterwards to confirm the database is clean.
  8. Investigate the underlying storage. Check the Windows Event Log (System) for disk, controller or StorPort warnings, review RAID controller logs, and check whether the volume is thin-provisioned or running low on space. Run the storage vendor's diagnostic tool. A single 1122 error after a power loss is often a torn page; repeated errors on the same file point at failing hardware.
  9. Verify backups and re-check. Run RESTORE VERIFYONLY against your backups and schedule regular DBCC CHECKDB jobs so future corruption is caught early, ideally on a copy or secondary rather than the production primary during peak hours.

Common Mistakes

  • Running REPAIR_ALLOW_DATA_LOSS first because it is fast. It can silently delete rows and does not always fix the root cause.
  • Ignoring the accompanying 823/824 errors and treating 1122 as a SQL Server bug. The storage layer is the usual culprit.
  • Restoring over the live database without taking a tail-log backup, losing transactions you could have saved.
  • Assuming a successful restore means the hardware is fine. The same failing disk will corrupt the restored copy too.
  • Running DBCC CHECKDB on a busy production server during business hours and blaming the resulting blocking on the corruption.

Tips

  • Run DBCC CHECKDB with WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY to get a complete, readable report.
  • Keep the hexadecimal address from the error message in your support ticket — Microsoft support and storage vendors often ask for it.
  • If the database is in an availability group, the fastest clean recovery is usually to drop the suspect replica and reseed it, not to repair it in place.
  • Store backups on separate physical storage from the data files so a controller failure does not take both copies.
  • Check that your antivirus exclusions follow Microsoft's guidance for SQL Server data and log folders — file-level scanning can contribute to I/O errors.

Troubleshooting

If DBCC CHECKDB reports no errors but the 1122 keeps appearing, the problem may be intermittent I/O. Enable read-retry (on by default in supported versions) and check for 825 messages. If the check itself fails to complete because of a corrupted system table, restore master or msdb from backup first, then re-run the check on the user database.

If a restore fails with a media error, the backup file itself may be damaged — try another backup set and run RESTORE HEADERONLY to see what is available. If repair reports that the database cannot be repaired, the only remaining option is to restore from backup or rebuild the database and export what data you can still read with SELECT ... INTO from surviving tables.

If the error returns on the same page after a successful repair, the disk is likely still returning bad data. Replace the failing drive or move the database files to healthy storage before restoring again.

Frequently Asked Questions

What does the address in error 1122 mean?

It is the memory address where the page check failed. It helps support engineers locate the failing code path; it is not a disk offset you can map to a file.

Can error 1122 fix itself?

No. A page that fails its checksum stays corrupt until it is restored, repaired or overwritten. Read-retry can mask a transient I/O problem, but you should still run a consistency check.

Is it safe to run REPAIR_ALLOW_DATA_LOSS?

Only as a last resort, with a full file-level copy of the database taken first. It can delete rows and pages, and it does not repair every type of corruption.

Will restarting SQL Server clear the error?

Restarting may clear the in-memory cache, but the corrupted page is still on disk. The error will return the next time that page is read.

Does error 1122 always mean the disk is failing?

No. A sudden power loss, a faulty controller, a hypervisor snapshot issue or a driver bug can all cause it. Repeated errors on the same file are the strongest signal of hardware trouble.

How often should I run DBCC CHECKDB?

Weekly is a common baseline for business-critical databases, with the schedule adjusted to your maintenance window and database size.