Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Suspect Databases

Author  Topic 

X002548
Not Just a Number

15586 Posts

Posted - 2008-08-05 : 09:47:55
Anyone know how I can tell which databases are suspect from the views or system tables in 2k?

sysdatabases has a status, but it doesn't tell you



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



krishnarajeesh
Yak Posting Veteran

67 Posts

Posted - 2008-08-05 : 14:25:46
Hi,
This should work, change code accordingly.

Select name as DBNAME,
case when (DATABASEPROPERTYEX(name,'status'))='suspect' then 'suspect' else status end as status
from sysdatabases


Thanks,
Krishna
www.SQLServer.in
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2008-08-14 : 12:14:43
Thanks

That throws an error for datatype conversion

But this is ok here

Select name as DBNAME, (DATABASEPROPERTYEX(name,'status'))
from master..sysdatabases


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -