Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using xp_fixeddrives on non-sql machines

Status
Not open for further replies.

jymm

Programmer
Apr 11, 2002
707
US
anyone know of an easy way to use the command 'Master..xp_fixeddrives' to pull the available space on any specified servers??? Right now it is nice to run this and see how much space is available on my server (and I hope to figure out how to actually push this information to a table so that I can track space utilization a bit better) BUT with that said it would also be nice to run the connected dll (xpstar.dll) on all of our servers regularly and store the result...

anyone else tried this & want to share?
 
I'm guessing you can't use it on a non-SQL machine. Why not? Well it uses the MASTER database for one. The MASTER db contains schema information and other data about the databases and the server. Also, the script is probably written in T-SQL which won't work on just any server.

-SQLBill
 
I don't know of any way to execute xp_fixeddrives to determine available space on other drives. Perhaps if can find the hooks into the DLL you could write a program.

You can insert the results of the procedure into table as in the following example. I use a temporary table. You will want to create a permanent table.

set nocount on

Create table #drives(Drive char(1), MBFree int)

insert #drives
exec dbo.xp_fixeddrives

select * from #drives

drop table #drives

If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top