June 9, 2003 at 6:50 am
I have some scripts to gather stats from several servers and it would be useful to be able to get total disk capacity. vbscript is not an option so it needs to be t-sql/ xp_cmdshell. Any undocumented SPs that might give this information?
June 9, 2003 at 6:59 am
You can use sp_OACreate and invoke the System.FileSystemObject.
From that you could get the avaliable size.
Not sure if there is a better way.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
June 9, 2003 at 2:03 pm
Exec Master..xp_fixeddrives will give you free space avail. in MB
MW
MW
June 12, 2003 at 4:06 am
Try
execute master..xp_cmdshell 'srvinfo -ns'
which gives you disk capacity, used and free
(Thanks to Bill from Walmart for this)
June 12, 2003 at 10:16 am
srvinfo gets a bunch of stuff, but takes some parsing.
Steve Jones
June 14, 2003 at 2:01 am
Thanks everyone for the replies - srvinfo looks like the one for me!
June 15, 2003 at 8:32 pm
"srvinfo" never worked for me. Am I missing something?
paul
paul
June 16, 2003 at 2:46 pm
What SQL Server version/pack needs to be installed to use srvinfo, or could you point me to some documentation on it. I checked BOL and didn't find anything. The reason why I ask is that I have some servers that xp_cmdshell 'srvinfo -ns' works for while others don't and SQL Server Version as well as pack is different on all of the machines.
Work like you don't need the money.
Love like you've never been hurt.
And Dance like no one is watching.
Work like you don't need the money.
Love like you've never been hurt.
And Dance like no one is watching.
June 16, 2003 at 3:00 pm
srvinfo comes with an Operating system's resource kit. I found it in NT 4.0's copy but found references in more recent kits. Unfortunately it isn't one of the tools available free through Microsoft's web site.
There is a way to get a comma delimited file of the drive, drive size, used space, free space for each drive on the server. But your SQL service account will need access those drives.
Hope this helps,
Michelle
Michelle
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply