January 9, 2014 at 2:38 am
Hi
I want to extract out some pretty simple statistics about each database on my SQL 2000 Instance; Database availability (online, accessible) and the last time the status of the database changed.
Is this at all possible in 2000? I'm struggling as I'm more used to 2008! 😀
January 9, 2014 at 2:43 am
Availability, yes, you'll need to decode the status and status2 columns in sysdatabases. Should be info in Books Online. As for when the status last changed, not unless you're tracking that information somehow.
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
January 9, 2014 at 4:42 am
I found a quicker way to find out that status, I query DATABASEPROPERTYEX, this gives me what I need (simply whether the database is ONLINE/OFFLINE). Now just working out how to wrap in one SELECT, so I can quickly identify the status of each database on the instance.
January 9, 2014 at 5:51 am
SELECT DATABASEPROPERTYEX .... FROM sysdatabases
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
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply