SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Checking for Available Disk Space (outside of SQL Server)


Checking for Available Disk Space (outside of SQL Server)

Author
Message
HookSqlDba7
HookSqlDba7
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2144 Visits: 534
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



arunyadav007
arunyadav007
SSC-Enthusiastic
SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)

Group: General Forum Members
Points: 150 Visits: 299
Hello Kevin,

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

Regards..
Scott D. Jacobson
Scott D. Jacobson
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1250 Visits: 1020
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
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50684 Visits: 17653
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" ;-)
HookSqlDba7
HookSqlDba7
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2144 Visits: 534
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



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search