March 20, 2008 at 6:04 am
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'))
March 20, 2008 at 6:24 am
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 ...
March 20, 2008 at 6:37 am
Select name, state_desc from sys.databases
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 20, 2008 at 6:48 am
Thanks a lot
March 20, 2008 at 6:49 am
Thanks a lot
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply