When you use DELETE WHERE CURRENT OF <cursor> command on SQL Server database, it could cause several SQL Server instabilities, including transient corruption. It could appear in error log with the given error messages:

“Error 605 Attempt to fetch logical page %LD in database ‘%.*s’ belongs to object ‘%.*s’, not to object ‘%.*s’”

Or

“Error 644 The non_clustered leaf row entry for page %ld row %d was not found in index page %ld indexid %d database ‘%.*s’”

Or

“Error 624 Attempt to retrieve row from page via RID failed because the requested RID has a higher number than the last RID on the page. %S_RID.%S_PAGE”

These error messages are only transient and don’t appear when your check the database consistency. Along with the database corruption, the server could also stop responding and might also face a handled access violation.

Cause

This problem could occur due to the application malfunction or conflict to the database components.

Nevertheless the reason of the problem, the results are very devastating. SQL Server database corruption is the situation which could not be faced at any cost as the corrupted database contains all of the business critical data of your organization.

Workaround

There is no fix of this problem is possible using the inbuilt database utilities as they can’t find the problem when you perform the database consistency checking. But you can stop this problem from being occurred in future by using any of the given methods:

  • Add unique index to the database tables
  • Rewrite the T-SQL to avoid the use of DELETE WHERE CURRENT OF <cursor> command

After applying these methods, you should think about the MDF recovery which is possible through the use of SQL recovery software. SQL recovery software are the applications specially designed to repair and restore the damaged SQL Server database.

Stellar Phoenix SQL Database Recovery software is the ultimate solution for all of your MDF corruption related issues. The easy and well-organized MDF repair is performed by this software by repairing and restoring all of your corrupted objects of MDF file including tables, reports, forms, data types, stored procedures etc.