February 26, 2003 at 6:33 am
I need a simple way of getting Disk Size (How big is the formatted disk, nothing installed) via T_SQL.
I do NOT need Free space.
February 26, 2003 at 10:09 am
xp_cmdshell 'dir c:' will get you this, but you have to parse.
Steve Jones
February 26, 2003 at 10:23 am
That would give the free disk space. Is there a dos command to see the total disk space (used and not)
February 27, 2003 at 4:31 am
Try
declare @o int, @d int, @t varchar(255)
exec sp_oacreate 'scripting.filesystemobject', @o out
exec sp_OAmethod @o, 'GetDrive', @d OUT, 'C:'
exec sp_OAGetProperty @d, 'TotalSize', @t OUT
select @t
exec sp_oadestroy @o
Far away is close at hand in the images of elsewhere.
Anon.
February 27, 2003 at 8:28 pm
Thanks David
The script works fine.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply