objecst ona filegroup

  • How do i find out all objects ona  specific filegroup. does anyone have a sql handy for this. TIA

  • Someone posted this a while ago

    SELECT  FG.groupid AS GroupID

    , SUBSTRING(FG.groupname,1,30) AS FilegroupName

    , SUBSTRING(O.name,1,30) AS ObjectName

    , ix.indid, ix.name as indexname

    , F.filename as FileNames

    FROM sysobjects O

     INNER JOIN sysindexes IX

      ON O.id = IX.id

     INNER JOIN sysfilegroups FG

      ON IX.groupid = FG.groupid

     INNER JOIN sysfiles F

      on F.groupid = FG.groupid

    -- WHERE   O.xtype = 'U'

    ORDER BY  FG.groupname, O.ObjectName


    * Noel

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

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