views:

373

answers:

2

Is there a way to find out the size of a SQL Server database using WMI from .NET?

I've had a look at the WMI documentation but I'm not clear how I'd be able to locate that information.

We're using SQL Server 2008.

-dave

+2  A: 

You can access this property via Microsoft.SqlServer.Management.Smo. Give this a try: MSDN

Louis Haußknecht
A: 

A bit of a tangential answer, but whenever I want to play with WMI, I first take a quick look with Scriptomatic, Microsoft's WMI browser.

Doing so against SQL Express 2005, the only WMI functionality seems to be with regard to the server itself, and not for any of the databases.

Arnout