Partion Number

  • Is there a query that I can run to determine what filegroup a partition number resides on? I used the $Partition Function to find the partition number. I've queried all of the catalog and system views, but I have yet to find a query that joins them all together to find out what filegroup a partition number resides on.

  • cathy.baker (12/16/2009)


    Is there a query that I can run to determine what filegroup a partition number resides on? I used the $Partition Function to find the partition number. I've queried all of the catalog and system views, but I have yet to find a query that joins them all together to find out what filegroup a partition number resides on.

    i.e.

    select ds.name AS [Filegroup Name], ds.type, destination_id AS [partition number], dds.partition_scheme_id, ps.name as [partition scheme]

    from sys.data_spaces ds

    join sys.destination_data_spaces dds

    on (ds.data_space_id = dds.data_space_id)

    join sys.partition_schemes ps

    on (ps.data_space_id = dds.partition_scheme_id)

    order by ds.name, ps.name ASC

  • Fabulous. Thanks!

  • NP 😀

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

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