SELECT DATABASEPROPERTYEX(db_name(), 'Status')
Return value:
ONLINE = Database is available for query.
OFFLINE = Database was explicitly taken offline.
RESTORING = Database is being restored.
RECOVERING = Database is recovering and not yet ready for queries.
SUSPECT = Database did not recover.
EMERGENCY = Database is in an emergency, read-only state. Access is restricted to sysadmin members
Saturday, September 19, 2009
Get database status
at 2:59 AM
Labels: DBA Tasks, SQL Server, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment