Home > Archive > MS SQL Server > November 2005 > SQL 2000 - Emptying last file in 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 SQL 2000 - Emptying last file in a Filegroup
D. Sutton

2005-11-30, 11:23 am

Hi all,

I have a DB with several filegroups that I am trying to consolidate back
into the PRIMARY FG. All the secondary FGs only have one file in them and all
of the tables have been dropped from the secondary FG and recreated in the
PRIMARY.

Normally to remove the FG I would use the T-SQL ALTER DATABASE ... REMOVE
FILEGROUP command but that only works once the FG is empty. The only T-SQL
command I know to try to empty a FG is the DBCC SHRINKFILE (..., EMPTYFILE)
command, but this only seems to work for consolidating files within the same
FG-- it doesn't allow me to consolidate from a secondary into the PRIMARY FG.

Q: How do I remove that last file in the filegroup so I can remove it from
the DB?

Thanks in advance.

D. Sutton
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