Finding FileGroup from table name

  • I'm trying to come up with a simple T-SQL statement that will return the filegroup that a particular table belongs to. I can't offhand see where sysobjects references anything I can join other tables with (like sysfiles) to determine this.

    This has to be a simple thing! Thanks.

  • This will get it but you have to have the Table ID which I have scripted to get then get group. Note: only shows Table filegroup not Text Filegroup.

    DECLARE @id INT

    SELECT @id = OBJECT_ID('tbl_name_here')

    EXEC sp_objectfilegroup @id

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

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

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