Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Checking for Available Disk Space (outside of SQL Server) Expand / Collapse
Author
Message
Posted Monday, December 3, 2012 6:59 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, October 3, 2014 8:55 AM
Points: 329, Visits: 369
We are running SQL Server 2005 SP4 on Windows Server 2008 R2 SE SP1 and Windows Server 2003 R2 SE SP2. I have created a SQL Server Job that returns free space using the xp_fixeddrives extended stored procedure. I was wondering if anyone knows of a simple, batch DOS job that would return the total and free space of the operating system and email the results. I would like to be able to find this information out without using SQL Server and without purchasing a third party product.


Thanks in advance, Kevin



Post #1391920
Posted Monday, December 3, 2012 7:09 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, July 24, 2014 11:46 PM
Points: 42, Visits: 290
Hello Kevin,

Please check this: http://ss64.org/viewtopic.php?id=930

Regards..
Post #1391927
Posted Monday, December 3, 2012 7:32 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 5:41 PM
Points: 356, Visits: 918
Personally, I'd go with Powershell for this. Server 2003 will need it installed if it's not already (it's an optional update). 2008 ships with it installed.

http://www.simple-talk.com/content/article.aspx?article=1339
Post #1391940
Posted Monday, December 3, 2012 1:47 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:08 PM
Points: 6,474, Visits: 13,933
The wmi comsole is pretty good here. The problem with xp_fixeddrives is it cant return mounted volume details. Use something along the lines of

wmic volume get capacity, "free space", name



-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs"
Post #1392134
Posted Friday, December 7, 2012 6:28 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, October 3, 2014 8:55 AM
Points: 329, Visits: 369
Thanks for all the responses.

Question1 - Why is this so difficult or cumbersome to do using the operating system? I think this is a common task that is required by network engineers, dbas, etc. I would like to check disk space at the operating system level and send an email just in case SQL Server is not running or for my servers where SQL Server is not installed.

(In my SQL Server Stored Procedure, I used xp_fixeddrives to get the drive and freespace information. Then I use OLE Automation to get the Total Size of each drive. This works fine and I can schedule it and send emails by creating a job and using sp_send_dbmail.)

Question2 - can the xp_fixeddrives stored procedure and OLE Automation be used with SQL Server Express 2005? Can a Job be setup and scheduled from SQL Server Express 2005?


Thanks in advance, Kevin



Post #1394032
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse