Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Resets the status of a suspect database.
Important
This feature will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER DATABASE instead.
Transact-SQL syntax conventions
sp_resetstatus [ @DBName = ] N'DBName'
[ ; ]
The name of the database to reset. @DBName 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 SQL Server error log should be consulted and all problems resolved before running this procedure. Stop and restart the instance of SQL Server 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, or execute permission directly on this stored procedure.
The following example resets the status of the AdventureWorks2022
database.
EXEC sp_resetstatus 'AdventureWorks2022';
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today