June 12th, 2019
February 26, 2021
Working on databases always needs the user to aware of the different types of issues and errors which may affect the database and the data stored inside the database files. In this paper, we will be going to discuss the common error faced by the SQL database users i.e SQL database error 5243.
SQL server prefaced two errors types of errors namely error 5243 or error 5242. When the SQL database administrator receives the aforementioned kind of error it means that the SQL server database is corrupt or damaged. This type of error is simply noticeable in the SQL database error log. If this type of error transpires, then you then the SQL user has to figure out what has befallen to the system. This SQL error details record type is unsuitable for the current type of page.
You can either restore the database SQL Server page or run DBCC CHECKDB Transact-SQL query.
If you are trying to restore the database SQL server page, note that there are two ways by which you can achieve this goal. You can use SQL Server Management Studio. A step by step procedure for restoring SQL Server Database is available in a separate <article link>article</article link>. Alternatively, you could run the T-SQL query in the MSDB database.
If you are choosing to write T-SQL queries make sure to check the corrupt page number. The corrupt page number can be found in the table “suspect_pages”. In order to refer to this table, you will need to write the following SQL query.
SELECT * FROM msdb..suspect_pages
WHERE (event_type = 1 OR event_type = 2 OR event_type = 3);
However, the more convenient way is to look for the corrupt page in the SQL server error log. After the corrupt page number is found, use the following T-SQL query.
RESTORE DATABASE <database_name>
PAGE = ‘<file: page> [ ,… n ] ‘ [ ,… n ]
FROM <backup_device> [ ,… n ]
DBCC CHECKDB can be used in order to repair the corrupt database. It provides two repairing modes, REPAIR_BUILD, and REPAIR_ALLOW_DATA_LOSS. It is recommended that you use REPAIR_BUILD mode as this can repair the database without any loss of data. REPAIR_ALLOW_DATA_LOSS can repair the database structure but there will be a data loss. Refer to Microsoft’s official DBCC CHECKDB documentation for better understanding of syntaxes, arguments, remarks, and practices.
It is probably likely that due to severe corruption, the methods mentioned may not be able to give a fruitful result. If so, you can try out SQL Database Recovery by SysInfoTools. Using this tool you can successfully recover data from corrupt MS SQL database files without having to write any queries.