Home > Archive > Microsoft SQL Server forum > March 2006 > Space Available Within A Filegroup









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Space Available Within A Filegroup
Greg.Harabedian@gmail.com

2006-03-05, 8:34 pm

I am using SQL Server 2000. How can I tell how much free space is
available within a particular filegroup? What query can I run to get
this information?
Thanks,
Greg

Erland Sommarskog

2006-03-05, 8:34 pm

(Greg.Harabedian@gmail.com) writes:
> I am using SQL Server 2000. How can I tell how much free space is
> available within a particular filegroup? What query can I run to get
> this information?


The used space in a file group in MB:

SELECT SUM(reserved)*8192/1000000 FROM sysindexes
WHERE indid IN (0, 1)
AND groupid = filegroup_id('YOURGR
OUP')

The total space available in a file group in MB:

SELECT SUM(size)*8192/1000000 FROM sysindexes
WHERE groupid = filegroup_id('YOURGR
OUP')

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com