May 11, 2011 at 5:10 am
For policy reasons I can't enable cmdshell.
I can get disk free space via xp_fixeddrives. But is it possible to get total disk space (ie. free space + used space).
I need this for all drives (so can't minus SQL file sizes off free space as there are non sql files).
I need to run on multiple instances & regularly.
Thanks in advance!
May 11, 2011 at 5:19 am
declare @driveName varchar(100)
declare @query varchar(1000)
declare @fsinfo varchar(1000)
set @driveName = 'C'
set @query ='fsutil volume diskfree '+@driveName+':\'
set @fsinfo = 'fsutil fsinfo volumeinfo '+@driveName+':\'
exec xp_cmdshell @query
exec xp_cmdshell @fsinfo
check this T-SQL
Regards,
Syed Jahanzaib Bin Hassan
BSCS | MCTS | MCITP | OCA | OCP | OCE | SCJP | IBMCDBA
My Blog
www.aureus-salah.com
May 11, 2011 at 5:23 am
Thanks, but I can't use cmdshell - frustrating I know!
May 11, 2011 at 5:26 am
By which I mean I'm prevented by standard operating procs here ... not that there's a technical issue in doing so.
May 11, 2011 at 6:21 am
Syed Jahanzaib Bin hassan (5/11/2011)
declare @driveName varchar(100)declare @query varchar(1000)
declare @fsinfo varchar(1000)
set @driveName = 'C'
set @query ='fsutil volume diskfree '+@driveName+':\'
set @fsinfo = 'fsutil fsinfo volumeinfo '+@driveName+':\'
exec xp_cmdshell @query
exec xp_cmdshell @fsinfo
check this T-SQL
Forgot to read again???
May 11, 2011 at 6:22 am
Is powershell an option? I can't code with it but I'm sure google would solve that one for ya.
<oi>sql?
SSIS?
May 11, 2011 at 6:26 am
You could always use SP_OACreate.
Look at this thread for a possible script:-
May 11, 2011 at 6:30 am
thanks guys. appreciate your time. i'll have a look @ those options now.
December 11, 2012 at 3:27 am
itws working
thanxs
December 11, 2012 at 3:28 am
thnxs
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy