Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL monitoring - space...

Author  Topic 

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2002-05-24 : 08:41:50
Hi all,

I'm trying to code some monitoring procedures which will gather statistics and information about servers and store them for analysis and use. So far so good ...

I would like to determine the amount of storage space on a SQL server box. NOTE that this would be the actual(total) space on the serfver. The xp_fixeddrives is nice - gives me free space on drives, which is very useful in monitoring and alerting (Hey - your space is LOW !!!) etc., but I'd like to determine total space as well.

I am trying to do this via SQL alone (that is to say, w/o coding other than stored proc's etc.). Are there any of the "unknown" (read- undocumented) stored procedures that do this or similar functions ? Lese does anyone know of any command line I can invoke from xp_cmdshell to do this? chkdsk is not ideal, since under NTFS I have issues when it determine that there are problems with indexes etc. Also, it's just too much of an overhead for what I'm trying to do.

Thanx all...

JamesH
Posting Yak Master

149 Posts

Posted - 2002-05-24 : 11:09:26
If you were to use xp_cmdshell with a 'dir' command (xp_cmdshell 'dir d:' and bring it into a table then you could get the information you're needing for that drive including file space used (bytes), and space available (bytes). I don't know of another way within SQLServer unless you actually wrote some vb script. It's the way I used to check space available for reporting on 6.0/6.5 servers.

Hope this helps.

JamesH.

Go to Top of Page
   

- Advertisement -