Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

filegroups and tables. Expand / Collapse
Posted Monday, August 27, 2012 2:13 AM


Group: General Forum Members
Last Login: Monday, December 5, 2016 2:41 AM
Points: 444, Visits: 2,158
How can I see which tables belong to a filegroup ?

(A selection which gives me all tables belonging to a single filegroup).

Thanks for your time and attention,
Ben brugman
Post #1350245
Posted Monday, August 27, 2012 2:22 AM



Group: General Forum Members
Last Login: Saturday, December 3, 2016 5:18 AM
Points: 45,619, Visits: 44,147
SELECT  OBJECT_NAME(object_id) AS TableName , AS IndexName , AS FileGroupName
FROM sys.data_spaces AS ds
INNER JOIN sys.indexes AS i ON ds.data_space_id = i.data_space_id

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1350250
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse