SQL Server error 824: Logical consistency-based I/O error
A page read from disk failed SQL Server's checks (bad checksum, torn page, wrong page ID). This is database corruption: run DBCC CHECKDB now.
- Error number
824- Severity
- 24
- Category
- Corruption and I/O
What it means
SQL Server verifies each page as it reads it, using the page checksum (or torn-page detection) and the page header. Error 824 means the read itself succeeded but the content is wrong: the data on disk is damaged. It is a severity 24 error, written to the error log, and the page is recorded in msdb.dbo.suspect_pages. The usual cause is the storage stack (disk, controller, drivers, SAN), not SQL Server.
Common causes
- Faulty disks, controllers, firmware or storage drivers writing or returning bad data.
- Power loss or a storage failure in the middle of a write without write-through protection.
- File system filter drivers (antivirus, backup tools) interfering with database files.
- Memory errors on the server corrupting pages before they were written.
How to fix it
-
Run a full consistency check to see the extent of the damage.
DBCC CHECKDB (N'SalesDb') WITH NO_INFOMSGS, ALL_ERRORMSGS;
-
See which pages were flagged.
SELECT * FROM msdb.dbo.suspect_pages;
-
The safe fix is restoring from backup. With the full recovery model and an unbroken log chain you can restore just the damaged pages.
RESTORE DATABASE SalesDb PAGE = '1:57' FROM DISK = N'D:\Backup\SalesDb.bak' WITH NORECOVERY; -- then restore subsequent log backups, back up the tail of the log, and restore it WITH RECOVERY
-
Check the storage: Windows event logs, hardware diagnostics, firmware and driver versions. Corruption comes back if the cause isn't fixed.
-
DBCC CHECKDB ... REPAIR_ALLOW_DATA_LOSSis a last resort when no backup exists, because it deletes whatever it can't repair.
Questions
Is error 824 a SQL Server bug?
Almost never. SQL Server is reporting that the page it read doesn't match what it wrote, which points to the I/O path: storage hardware, drivers or filter drivers.
Related errors
823Operating system returned an I/O error825Read retry succeeded after failing9001The log for database is not availableXX001PostgreSQL: data corruptedSQLITE_CORRUPTSQLite: database disk image is malformed
The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.
Work on SQL Server in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.