Query Which Tables are Partitioned

List out which tables are partitioned, and what partition scheme and partition function they use: [cc lang=”sql”] select t.name as TableName, ps.name as PartitionScheme, ps.data_space_id, pf.name as PartitionFunction, pf.function_id from sys.tables t join sys.indexes i on t.object_id = i.object_id join sys.partition_schemes ps on i.data_space_id = ps.data_space_id join sys.partition_functions pf on ps.function_id = pf.function_id where i.index_id < 2 [/cc] For a given partition function, list each of the boundary values [cc lang=”sql”] select r.boundary_id, r.value from sys.partition_range_values r join sys.partition_functions pf on r.function_id = pf.function_id where pf.name = ‘fnQuarters’ — partition function name order by r.value [/cc]

Continue reading ...

Featured Articles

 Site Author

  • Thanks for visiting!
css.php