Below are the possible status of database.
- ONLINE : Database is available for access.
- RESTORING : Primary file group and secondary files are being restored.
- RECOVERING : Database is being recovered.
- RECOVERY PENDING : Resource-related error occurred during recovery.
- OFFLINE : Database is unavailable to access.
- SUSPECT : One or many primary file group is suspect and may be damaged.
- EMERGENCY : User has changed the database and set the status to EMERGENCY.
Here is query for this.
SELECT DATABASEPROPERTYEX('NorthWind', 'Status') Database_Status SELECT state_desc Database_Status FROM sys.databases WHERE name = 'NorthWind'
|(To view original image , click on image)|