// SQL Server error reference

SQL Server error 823: Operating system returned an I/O error

Windows or Linux reported an error when SQL Server read or wrote a database file. Treat it as a storage failure and check database integrity.

Error number
823
Severity
24
Category
Corruption and I/O
Error message
The operating system returned error %ls to SQL Server during a %S_MSG at offset %#016I64x in file '%ls'. Additional messages in the SQL Server error log and operating system error log may provide more detail. This is a severe system-level 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 SQL Server Books Online.

What it means

Error 823 means the read or write call itself failed at the operating system level, and the message includes the OS error code. Unlike 824, where data came back but was wrong, here the I/O request didn't complete. It is severity 24 and threatens database integrity.

Common causes

  • Disk or storage hardware failures, bad sectors, or a disconnected SAN or network volume.
  • Driver or firmware problems in the storage stack.
  • The volume holding the files went offline or was dismounted.

How to fix it

  1. Check the operating system and hardware logs for disk errors at the same time.

  2. Run a consistency check once storage is stable.

    DBCC CHECKDB (N'SalesDb') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  3. Restore damaged pages or the database from backup if CHECKDB reports errors, and move the database to healthy storage.

Related errors

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.

// fewer errors, faster fixes

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.