Skip to content
  • There are no suggestions because the search field is empty.

Desktop POS: Suspect Database Repair Query

Instructions to run a Query for a Suspect Database

This is a multi-query process
  • Run them in this order:
EXEC sp_resetstatus [YourDatabase];
  • This query will reset the "suspect" flag on the database
  • You may be able to backup the database after this query. Give this a shot before proceeding any further.

DBCC checkdb([YourDatabase])
  • Review results and see if there consistency errors
  • If there are errors, check to see if there is a current backup that you can restore. If not, then we will need to repair the datbase.
  • First set it to Single User Mode (You can also do this via the properties of the database):

ALTER DATABASE [YourDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  • Then run CheckDB with Repair Allow Data Loss (This will repair the corrupted references/indexes in the database):

DBCC CheckDB ([YourDatabase], REPAIR_ALLOW_DATA_LOSS)
  • Put the database back into Multi-User mode (You can also do this via the properties of the database):

ALTER DATABASE [YourDatabase] SET MULTI_USER

On a side note, it is a good idea to transfer a copy of the database backup from before the suspect DB event to your machine, just in case. IE: database goes suspect on Monday, you pull over their database backup from Sunday. This copy will be used if we determine there is any data loss due to the suspect status.