sp_resetstatus (Transact-SQL)
SQL Server 2008 Books Online (November 2009)
sp_resetstatus (Transact-SQL)

Resets the status of a suspect database.

ms188424.note(en-us,SQL.100).gifImportant:
This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER DATABASE instead.

Topic link icon Transact-SQL Syntax Conventions

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 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.

Permissions

Requires membership in the sysadmin fixed server role.

Examples

The following example resets the status of the AdventureWorks database.

EXEC sp_resetstatus 'AdventureWorks';
See Also

Reference

System Stored Procedures (Transact-SQL)
Database Engine Stored Procedures (Transact-SQL)

Help and Information

Getting SQL Server 2008 Assistance
© 2010 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View