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 Development (2000)
 off topic: drive's volumn?

Author  Topic 

Ali Chadorbaf
Starting Member

44 Posts

Posted - 2007-05-03 : 19:18:49
Hi,
Any function or so to get drive's capacity, drive's used volume, and drive’s free volume?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-03 : 19:24:03
use xp_fixeddrives

http://www.databasejournal.com/features/mssql/article.php/3080501

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Ali Chadorbaf
Starting Member

44 Posts

Posted - 2007-05-03 : 19:49:25
That's very good. Tons of thanks.

This covers most of my needs. It would be perfect if ,by any chance, there is another similar method to capture the drive's capacity too. Any?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-05-03 : 20:01:35
You can derive that info with Performance Monitor counters.

LogicalDisk:% Free Space
LogicalDisk:Free Megabytes

If you know how much free space you have, what the % is, then you can derive the capacity via simple math.

Performance Monitor counters can be called programmatically in .NET, therefore you can get to this information via a CLR function if you are using SQL Server 2005 (which you probably aren't given the forum you posted in).

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -