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: Today @ 3:02 AM
Points: 440, Visits: 2,129
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: Today @ 10:37 AM
Points: 45,433, Visits: 43,781
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