dakshinamurthy (3/20/2008)
Hi,If i would like to know, whether a particular DB is online or has gone to a suspect mode, can i use the following query, so that once the status is suspect we can send a mail to the Administrator to look into it.
Please suggest if there is any other way to find the status of the DB, if the DB has entered into a Suspect mode can i send mail.
SELECT Convert(Varchar(20),DATABASEPROPERTYEX('dbsub', 'Status'))
That would work. Something like:
IF DATABASEPROPERTYEX('dbsub', 'Status') <> 'ONLINE'
EXEC sp_send_dbmail ...