Wednesday, March 28, 2012

How can I check..

I have one database file in separate filegroup. I can't delete this file
because it is not empty.
How can I check which table is a part of this database file ?The easiest way is to do into Enterprise Manager, select
the table, right click and go to properties.
If you have a lot of tables then you can script them out
by selecting the database, all tasks, generate sql script,
then open it up in QA and do a search for the filegroup
you want to remove.
Peter
"I favor the Civil Rights Act of 1964 and it must be
enforced at gunpoint if necessary."
Ronald Reagan
>--Original Message--
>I have one database file in separate filegroup. I can't
delete this file
>because it is not empty.
>How can I check which table is a part of this database
file ?
>.
>|||select id, object_name(id) as 'Object', indid, name, s.groupid, fg.groupname
from sysindexes s inner join sysfilegroups fg
on s.groupid = fg.groupid
you can also put a where fg.groupname = 'myfilegroup'
to see only the objects on a particular FG
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"MK" <MK@.discussions.microsoft.com> wrote in message
news:FEC364E9-20CE-468B-A961-E56D70508032@.microsoft.com...
> I have one database file in separate filegroup. I can't delete this file
> because it is not empty.
> How can I check which table is a part of this database file ?

No comments:

Post a Comment