sp_resetstatus
Resets the status of a suspect database.
Syntax
sp_resetstatus [ @DBName = ] 'database'
Arguments
[@DBName =] 'database'
Is the name of the database to reset. database is sysname, with no default.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_resetstatus turns off the suspect flag on a database. This procedure updates the mode and status columns of the named database in sysdatabases. The SQL Server error log should be consulted and all problems resolved before running this procedure. Stop and restart SQL Server after executing sp_resetstatus.
A database can become suspect for several reasons. Possible causes include denial of access to a database resource by the operating system, and the unavailability or corruption of one or more database files.
Permissions
Only members of the sysadmin fixed server role can execute sp_resetstatus.
Examples
This example resets the status of the PUBS database.
EXEC sp_resetstatus 'PUBS'