Which Object In Which FileGroup

To find which object exists in which file group execute the below code


SELECT OBJ.name AS ObjectName, OBJ.type AS ObjectType, IND.name AS IndexName, FG.name AS FileGroup
FROM sys.indexes Ind
INNER JOIN sys.filegroups FG
ON IND.data_space_id = FG.data_space_id
INNER JOIN sys.all_objects OBJ
ON IND.object_id = OBJ.object_id
WHERE IND.data_space_id = FG.data_space_id


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: