How to get available space for the Drive where a database Data File is located

  • I got requirements for a web application (back-end is SqlServer) that needs below informations got presented on a web page:

    1. Drive Space Available (Drive where Data File is located)

    2. Percent(%) of Drive Space Free

    How I can implement this by using SMO (Sqlserver Management Object)

    Thanks a lot,

    Mark

  • Using XP_FIXEDDRIVES you can get the free disk space in all drives:D

  • Is there anyway to get those information by SMO(Sqlserver Management Object)

  • Here is a script that will return all of the information. Do you have to use SMO?

    http://www.mssqltips.com/tip.asp?tip=1510

  • SMO doesn't support drive enumeration...it's only relevant to SQL Server objects.

    You'll need to use WMI or a FileSystemObject. I'll have a solution for this posted on my blog[/url] shortly using Powershell & WMI. Stay tuned if you're interested....

    Your friendly High-Tech Janitor... 🙂

  • Very exicted to hear you will have a solution posted very soon. When is it suppose to be there? I would appreciate your help very much.

    Thanks a lot,

    Mark

  • A day or so. I'm going to finish a current topic and then post the script in another entry.

    Your friendly High-Tech Janitor... 🙂

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply