Sql server makes use of MDF files in order to store user’s important data and with the help of various queries to add, delete or modify the data, the modification is made in the database files. But while executing the queries, you can face a number of errors which can be difficult to be detected as only the number indicates you the error.
One such is sql error 823 that appears due to disk read errors or database corruption. In that situation, you need to repair and rebuild the database.
Suppose a situation where you are executing queries to modify the data within MDF files, but you get error 823 on the screen. The following information is logged into the error log file:
“2010-06-10 12:11:29.55 spid58 Error: 823, Severity: 24, State: 2. 2010-06-10 12:11:29.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\MSSQL10.SQL2008\MSSQL\DATA\mysqldatabase.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. This error often occurs due to error in database pages (including page id error). Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors.”
Cause:
The reasons for this error 823 can be database file corruption or database inconsistency
Solution:
In order to fix fatal error 823 in Sql server, you need to go through the below solutions:
In case if the error is due to database inconsistency, you have to reinstate it to the consistent state. To do this, you can go for chkdsk utility that works to detect and fix up all the issues related with database inconsistency
On the contrary, in case of database corruption you can use mysql command line repair such as DBCC CHECKDB command to check the database or can make in other case may use sql repair tool to resolve up the database corruption issues in an efficient manner.