Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database size via WMI in .NET

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

like image 382
David Gardiner Avatar asked Nov 06 '22 22:11

David Gardiner


1 Answers

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

like image 104
Louis Haußknecht Avatar answered Nov 15 '22 06:11

Louis Haußknecht