Monday, November 13, 2006

Finding your group(file)

Managing tables into filegroups can be a very daunting task when you start to look at huge database systems. The following script always helps me to locate what table is in which filegroup.

It helps to keep things neat and tidy.

SELECT, s.groupname,
FROM dbo.sysfilegroups s
INNER JOIN dbo.sysindexes i
ON i.groupid = s.groupid
INNER JOIN dbo.sysfiles f
ON f.groupid = s.groupid
INNER JOIN dbo.sysobjects o
ON = object_id(
AND i.indid in (0, 1)

No comments:

Post a Comment