How to know the Partion Scheme used from a TableName

  • Hi All,

    I am trying to automate my partition script. I have one concern.

    My stored procedure will take the table name and I need to determine the Partition scheme used by the table using TSQL script.

    Thanks,

    Swaroop

  • select 'scheme' = a.name,

    'function' = b.name

    from sys.indexes i

    inner join sys.partition_schemes a on a.data_space_id = i.data_space_id

    inner join sys.partition_functions b on a.function_id = b.function_id

    where i.object_id = object_id('dbo.Table_Orders')

    Vishal Gajjar
    http://SqlAndMe.com

  • Thank you Vishal

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

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