如何在SQL 2005中获取分区范围

时间:2021-04-03 16:27:24

I have a partitioned table in SQL Enterprise 2005. I need to query the PARTITION FUNCTION to find it's partition ranges. What SQL query will give me those values?

我在SQL Enterprise 2005中有一个分区表。我需要查询PARTITION FUNCTION以找到它的分区范围。什么SQL查询会给我这些值?

1 个解决方案

#1


5  

Got this from the SQL profiler watching the management studio generate the script for creating the function

从SQL分析器中看到管理工作室生成用于创建函数的脚本

SELECT sprv.value AS [Value],
       sprv.boundary_id AS [ID]
FROM sys.partition_functions AS spf
     INNER JOIN sys.partition_range_values sprv 
        ON sprv.function_id=spf.function_id
WHERE (spf.name=N'fnPartitionLast30Days')
ORDER BY [ID] ASC

#1


5  

Got this from the SQL profiler watching the management studio generate the script for creating the function

从SQL分析器中看到管理工作室生成用于创建函数的脚本

SELECT sprv.value AS [Value],
       sprv.boundary_id AS [ID]
FROM sys.partition_functions AS spf
     INNER JOIN sys.partition_range_values sprv 
        ON sprv.function_id=spf.function_id
WHERE (spf.name=N'fnPartitionLast30Days')
ORDER BY [ID] ASC