find objects on file/filegroup

  • Is there a way to determine what objects live on a particular file in the database.  I have a vendor designed db with over 90 files and over 90 filegroups.  I need to try and restructure some of this and was looking for some way to find the objects on a particular file/filegroup.  Any assistance will be greatly appreciated.

    TIA

  • Maybe you can use this query with a little tweaking.

    select Object_name = o.name,

              Object_type = o.xtype, 

              Data_located_on_filegroup = g.groupname,

              Data_located_on_file = s.name

       from sysobjects o, sysfiles s, sysindexes i, sysfilegroups g

       where  i.indid < 2

           and i.groupid = g.groupid

           and s.groupid = g.groupid

       order by Object_type

    Greg

     

    Greg

  • Thanks!  My brain must have fallen asleep as I didn't think of joining the tables that way.

    l

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply