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)
 Is it possible to calculate

Author  Topic 

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2006-03-08 : 11:19:13
Is it possible to calculate the free disc space using T-SQL for SQL Server 7 running on Windows NT. Everything I have seen is aimed at SQL Server 2000 or Windows 2000?

Anyone have any suggestions?

thanks

steve

-----------

Oh, so they have internet on computers now!

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-03-08 : 11:29:33
Is xp_fixeddrives available in 7?
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-03-08 : 11:49:59
http://www.databasejournal.com/scripts/article.php/1470811

Go with the flow & have fun! Else fight the flow
Go to Top of Page

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2006-03-08 : 14:10:05
xp_fixeddrives was my friend as far back as 6.5. Probably was in earlier than that.
Go to Top of Page

elwoos
Master Smack Fu Yak Hacker

2052 Posts

Posted - 2006-03-09 : 06:18:47
I'm sure xp_fixeddrives didn't work yesterday!! It does of course now!! Thanks both

Thanks also to spirit for the link. At first I thought this was something I found yesterday that uses scripting (and so doesn't work) but on closer inspection I can adapt it to my needs. My only minor concern is that it also uses xp_fixeddrives which is undocumented!

thanks again to all

steve

-----------

Oh, so they have internet on computers now!
Go to Top of Page

JoeNak
Constraint Violating Yak Guru

292 Posts

Posted - 2006-03-09 : 11:34:27
If you're wanting to avoid xp_fixeddrives...
http://www.databasejournal.com/scripts/article.php/1476381
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-03-09 : 12:55:37
You might be able to do something with an xp_cmdshell and:

dir c: | find "bytes free"

Kristen
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-09 : 19:47:22
wow, that was handy.... thanks for the tip Kristen!

much oblige, yeah old bean!


--------------------
keeping it simple...
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-03-09 : 20:42:35
You can use PSINFO from sysinternals; it calculate the free space for you.
http://www.sysinternals.com/Utilities/PsInfo.html

The PsTools zip file contains PSINFO and a lot more useful utilities
http://www.sysinternals.com/Utilities/PsTools.html

The are very useful, because you can do stuff to remote systems, like start and stop services, reboot, execute commands, etc. I've used them for years, and never had a problem with them.

The tools included in the PsTools suite:
PsExec - execute processes remotely
PsFile - shows files opened remotely
PsGetSid - display the SID of a computer or a user
PsKill - kill processes by name or process ID
PsInfo - list information about a system
PsList - list detailed information about processes
PsLoggedOn - see who's logged on locally and via resource sharing (full source is included)
PsLogList - dump event log records
PsPasswd - changes account passwords
PsService - view and control services
PsShutdown - shuts down and optionally reboots a computer
PsSuspend - suspends processes


Get Disk Info with PsInfo:

C:\SysInternals>psinfo -d filter

PsInfo v1.73 - Local and remote system information viewer
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com

System information for \\MYCOMPUTER:

Volume Type Format Label Size Free Free
A: Removable 0.0%
C: Fixed NTFS 37.27 GB 22.66 GB 60.8%
D: Removable 0.0%
E: CD-ROM 0.0%
F: CD-ROM 0.0%

Help for PSINFO

C:\SysInternals>psinfo /?

PsInfo v1.73 - Local and remote system information viewer
Copyright (C) 2001-2005 Mark Russinovich
Sysinternals - www.sysinternals.com

PsInfo returns information about a local or remote Windows NT/2000/XP system.

Usage: psinfo [-h] [-s] [-d] [-c [-t delimiter]] [filter] [\\computer[,computer[,..]]|@file [-u Username [-p Password]]]
-u Specifies optional user name for login to
remote computer.
-p Specifies password for user name.
-h Show installed hotfixes.
-s Show installed software.
-d Show disk volume information.
-c Print in CSV format
-t The default delimiter for the -c option is a comma,
but can be overriden with the specified character. Use
"\t" to specify tab.
filter Psinfo will only show data for the field matching the filter.
e.g. "psinfo service" lists only the service pack field.
computer Direct PsInfo to perform the command on the remote
computer or computers specified. If you omit the computer
name PsInfo runs the command on the local system,
and if you specify a wildcard (\\*), PsInfo runs the
command on all computers in the current domain.
@file PsInfo will run against the computers listed in the file
specified.





CODO ERGO SUM
Go to Top of Page
   

- Advertisement -