| title | sp_resetstatus (Transact-SQL) | Microsoft Docs | ||
|---|---|---|---|
| ms.custom | |||
| ms.date | 03/14/2017 | ||
| ms.prod | sql-non-specified | ||
| ms.reviewer | |||
| ms.suite | |||
| ms.technology |
|
||
| ms.tgt_pltfrm | |||
| ms.topic | language-reference | ||
| f1_keywords |
|
||
| dev_langs |
|
||
| helpviewer_keywords |
|
||
| ms.assetid | b892727f-ea3b-4b94-88d9-f2386ad4962c | ||
| caps.latest.revision | 17 | ||
| author | BYHAM | ||
| ms.author | rickbyh | ||
| manager | jhubbard |
[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md]
Resets the status of a suspect database.
Important
[!INCLUDEssNoteDepFutureAvoid] Use ALTER DATABASE instead.
| Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version). |
Transact-SQL Syntax Conventions
sp_resetstatus [ @dbname = ] 'database'
[ @dbname= ] 'database'
Is the name of the database to reset. database is sysname, with no default.
0 (success) or 1 (failure)
sp_resetstatus turns off the suspect flag on a database. This procedure updates the mode and status columns of the named database in sys.databases. The [!INCLUDEssNoVersion] error log should be consulted and all problems resolved before running this procedure. Stop and restart the instance of [!INCLUDEssNoVersion] after you execute 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.
Requires membership in the sysadmin fixed server role.
The following example resets the status of the AdventureWorks2012 database.
EXEC sp_resetstatus 'AdventureWorks2012';
System Stored Procedures (Transact-SQL)
Database Engine Stored Procedures (Transact-SQL)