- Error number
- 824
- Severity
- 24 (fatal: the connection ends; may indicate a serious problem)
- State
- 2
- Product
- Microsoft SQL Server Database Engine
- Versions
- All supported SQL Server versions (2016 to 2025), Azure SQL Managed Instance
- Category
- Corruption & Consistency
- Last reviewed
- 23 October 2026
On this page
What it means
Error 824 means Windows read a database page without complaint but SQL Server found the page damaged, which almost always points to a storage, driver or hardware problem.
SQL Server checks every page it reads: its checksum, its torn-page bits, that it is the page it asked for, and more. Error 824 means the read itself succeeded but one of these checks failed; the text after the colon names the check (for example incorrect checksum or incorrect pageid). The closely related error 823 means Windows reported the read or write as failed.
Severity 24 is a hardware or media error: the query fails and the connection is closed. The damage is in the data file, so it will not go away by retrying. Treat 824 as an urgent integrity incident: find out how much is damaged, fix the storage path, and restore from a clean backup. SQL Server records the page in msdb.dbo.suspect_pages.
Common causes
- A failing disk, controller or storage array, or outdated firmware.
- A faulty or outdated storage driver, multipath software or virtualisation storage driver.
- Filter drivers in the I/O path, such as antivirus or backup agents, interfering with database files.
- Write caching that does not survive a power loss, leaving a partly written (torn) page.
Diagnose it
Read-only These queries only read metadata and dynamic management views. They do not change data, permissions or configuration, so they are safe to run first.
Which pages are recorded as suspect?
SELECT DB_NAME(database_id) AS database_name, file_id, page_id,
event_type, error_count, last_update_date
FROM msdb.dbo.suspect_pages
WHERE event_type IN (1, 2, 3); One row per damaged page (event types 1 to 3 are 823 or 824 errors, bad checksums and torn pages). Pages in several databases on the same volume point strongly to the storage.
Is page checksum verification on?
SELECT name, page_verify_option_desc
FROM sys.databases
WHERE page_verify_option_desc <> 'CHECKSUM'; Databases listed here are not using CHECKSUM, the strongest page verification; turn it on (see the fixes).
Run a full consistency check
DBCC CHECKDB without a repair option only reads and reports. It is heavy on I/O and CPU, so run it off-peak, or on a restored copy of the database on other hardware.
DBCC CHECKDB (N'AppDb') WITH NO_INFOMSGS, ALL_ERRORMSGS; No output means no consistency errors were found. Otherwise the last lines state the minimum repair level; use them to judge the extent of the damage, not as an instruction to repair.
Find the 823, 824 and 825 messages in the error log
EXEC sp_readerrorlog 0, 1, N'I/O error';
EXEC sp_readerrorlog 0, 1, N'Error: 825'; Every I/O error with its file, page and check. Error 825 (a read that succeeded only after retrying) is an early warning of the same problem.
How to fix it
Each fix is labelled with what it changes. Try read-only checks and the least invasive fix first, and test changes outside production.
Fix the storage path first
Client or network sideCheck the Windows System event log for disk, controller or driver errors, update storage firmware and drivers, review filter drivers (fltmc filters) and exclude database files from antivirus scanning. Microsoft SQLIOSim can test whether the storage can reproduce the problem. Until the cause is fixed, new damage can appear.
Restore from a clean backup
Changes database stateRestoring is the safe way to recover damaged pages. With the full recovery model and an unbroken chain of log backups you can restore without losing committed work. A single-page restore is possible when only a few pages are damaged. Restore onto healthy storage, then run DBCC CHECKDB on the result.
Caution: RESTORE with REPLACE overwrites the current database. Back up the tail of the log first (BACKUP LOG ... WITH NO_TRUNCATE if the database is damaged) so no committed work is lost, and rehearse on a copy if you can.
-- Example: restore a single damaged page, then roll forward with log backups
RESTORE DATABASE AppDb PAGE = '1:43686'
FROM DISK = N'D:\Backups\AppDb_full.bak'
WITH NORECOVERY;
-- then RESTORE LOG ... WITH NORECOVERY for each log backup,
-- take a new log backup, restore it, and finish WITH RECOVERY.
Turn on CHECKSUM page verification
Changes configurationCHECKSUM detects damage most reliably. Pages get a checksum the next time they are written, so existing pages are protected gradually.
ALTER DATABASE AppDb SET PAGE_VERIFY CHECKSUM;
Examples
A query that reads a damaged page
Shown as documented by Microsoft; not reproduced here because it requires damaging a data file. The query fails and the connection is closed. The error log also records Error: 824, Severity: 24, State: 2.
SELECT * FROM dbo.Orders;
Msg 824, Level 24, State 2, Line 1 SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:43686; actual 0:0). It occurred during a read of page (1:43686) in database ID 23 at offset 0x0000001554c000 in file 'D:\SqlData\AppDb.mdf'. Additional messages in the SQL Server error log or operating system error log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see https://go.microsoft.com/fwlink/?linkid=2252374.
How to prevent it
Keep PAGE_VERIFY CHECKSUM on for every database, back up WITH CHECKSUM, and run DBCC CHECKDB on a schedule (or on restored copies) so damage is found early. Alert on errors 823, 824 and 825 and on new rows in msdb.dbo.suspect_pages.
Most importantly, test restores. A backup you have restored recently is what turns an 824 into a short outage rather than data loss.
Common questions
Should I run DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS?
Not as a fix. Repair with data loss deletes whatever it cannot fix, can break relationships between tables, and is only a last resort when no usable backup exists. Restore from a clean backup instead, and if you truly have no backup, get expert help and work on a copy first.
What is the difference between error 823 and 824?
Error 823 means Windows reported the read or write as failed. Error 824 means Windows reported success but SQL Server found the page damaged. Both point to the storage path.
Can I just retry the query?
No. The damage is on disk, so the page will fail every time it is read. Investigate and restore.
Learn more on CodeWithSQL
Official documentation
- MSSQLSERVER_824 (Microsoft Learn)
- Manage the suspect_pages table
- Restore pages (SQL Server)
- DBCC CHECKDB (Transact-SQL)
Last technically reviewed 23 October 2026; examples and diagnostics run on SQL Server 2025 (17.0.1145.4). Message text checked against the engine's sys.messages catalogue.