Follow SQLMaster on Twitter
Welcome to SqlServer-QA.net Sign in | Help

SQL Server- TSQL to see which object reside under which file groups?

To continue the FIND-FilegroupFull post on the filegroups, here is the most common question on the forums to get which object reside under which filegroup if there are multiple ones associated:

 

select si.rows as 'Rows', SO.Name as Table, SI.name as 'Index', SFG.groupname as 'Filegroup'
from sysobjects as SO
    join sysindexes as SI
    on SO.Id = SI.id
    join sysfilegroups as SFG
    on SI.GroupId = SFG.GroupId
order by si.rows desc, SO.Name , SI.name, SFG.GroupName

(Luis Martin from [SSP])

Published Monday, December 24, 2007 3:40 AM by SQL Master

Comments

# SQL Server- TSQL to see which object reside under which file groups?

To continue the FIND-FilegroupFull post on the filegroups, here is the most common question on the forums

Monday, December 24, 2007 5:11 AM by Other SQL Server Blogs around the Web

# SQL Server- TSQL to see which object reside under which file groups?

To continue the FIND-FilegroupFull post on the filegroups, here is the most common question on the forums

Monday, December 24, 2007 5:12 AM by SSQA.net - SqlServer-QA.net

# sql server t sql date

Tuesday, July 15, 2008 8:12 AM by sql server t sql date
Anonymous comments are disabled