Quick Methods to Fix SQL Server Error 823

admin ~ Modified: 05-12-2022 ~ SQL Server , Technology ~ 5 Minutes Reading

Are you getting errors while accessing your SQL Server database?Are you unable to perform any Input/Output operation on your database? Well, this problem generally occurs due to either SQL Server database corruption or Windows API problem. The error 823 can lead to severe data loss situations. Therefore, in order to get your critical data back, you need to know how to fix SQL server error 823.

What is SQL Server Error 823?

SQL is the most common database management system, which provides flexibility to the administrator to manage their database. SQL Server uses Windows API such as ReadFile, WriteFile, ReadFileScatter etc. to perform the input/output operations. After performing these operations, if these API calls fail with an operating system error, then SQL server reports an error code 823. The SQL server error message 823 usually indicates that there is a problem with the storage system or the hardware that is in the path of the input/output request. A user can encounter this error message, when there are inconsistencies in the file system or if the database file is damaged.

How to Fix SQL Server Error 823?

Error Message 823:

The SQL server error message 823 will be displayed like this message:

Error: 823, Severity: 24, State: 2.
2010-03-06 22:41:19.55 spid58 The operating system returned error 38 (Reached the end of the file.) to SQL Server during a read at offset 0x000000a72c0000 in file ‘C:\Program Files\Microsoft SQL Server\ MSSQL\DATA\db.mdf’. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe, system-level error condition that threatens database integrity and must be corrected immediately. It is recommended to complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

Download SQL Recovery Purchase Now 100% Secure

What Problems are Associated With the SQL Server Error 823?

  • A Torn Page
    A torn page is incorrectly written page and its detection writes a bit for every 512 bytes in the page. Basically, it allows detecting the page, when it is not successfully written to disk. But it is not able to show the page when the data stored to disk is actually correct. Users can detect these errors after running the CHECKDB command in the database.
  • Bad Page ID
    Bad page ID problem arises when the header page ID is not the same as the expected one while reading in the disk.
  • Insufficient bytes transferred
    Insufficient bytes transferred means the API calls were invoked successfully, but the bytes transferred are not the expected ones.

How to Fix SQL Server Error 823?

There are two manual methods available to resolve SQL server error 823:

Solution 1:

To fix this error, run a DBCC CHECKDB command and try to repair the database using the following sentence:


If you want to use single user mode, then change the mode. For doing this, you can use the following T-SQL sentence:


Solution 2:

Another way to fix SQL server error 823 is to right-click on the database in SQL Server Management Studio (SSMS) and go to the Select a page menu and choose Options. After that, to restrict access, select SINGLE USER option.

Run “DBCC CHECKDB” Command again to verify that the database was repaired:

  1. If the problem arises, it may be a hardware problem. Then, you need to repair your hard disk. For this, contact with the IT members in charge of the hardware. Check also if there are fragmentation problems on the hard disk.
  2. Another option may be to restore your database with a backup. Once the database is restored, run a CHECKDB command to verify that the problem is resolved.
  3. If you have a Torn page error, then you can use the CHECKSUM and the torn page detection to repair and verify the errors.

A Professional Tool to Fix SQL Server Error 823

If the above methods fail to perform SQL Server recovery and it still shows error message 823. Then, it is required to opt a third-party tool like Revove SQL Recovery Tool to eliminate errors, repair corrupt files, and to produce fresh files. This tool is user-friendly and it offers ingenious features to fix SQL Server Error 823 and restore the database. This software is designed to fix the corrupt databases of Microsoft SQL Server 2019, 2017, 2016, 2014, 2012,  2008, 2005, 2000, and 7.0. It restores the tables, reports, macros, stored procedures, constraints, forms, triggers, default constraints, and other SQL database objects. Also this application provides the facility to recover the deleted SQL table records. The software follows a simple and quick process to fix the SQL server error 823.

Also Read: How to Fix SQL Server Backup Database Error 3013?

The Bottom Line

In this article, we have discussed different problems that associated with this error code 823. Then, we learned how to fix SQL server error 823. This SQL server error code 823 is the very common issue faced by SQL Administrators. Though, they can try to fix this error manually or with the help of a third-party tool.