How to get partition ranges in SQL 2005

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?

  • Why use a READ UNCOMMITTED isolation level?
  • DELETE EXCEPT TOP 1
  • SQL Server PIVOT Column Data
  • I am having trouble getting the correct results using XML EXPLICIT in T-SQL (SQL Server 2008)
  • Update large number of rows - SQL Server 2005
  • Flattening intersecting timespans
  • T-SQL progressive numbering partitions
  • T-SQL - create partition function and scheme - SQL Server 2008
  • Will SQL Server Partitioning increase performance without changing filegroups
  • Full Text Search Auto-Partition Schemes and Functions
  • Can I ALTER a partitioned table in SQL Server 2005?
  • Partition Or Separate Table
  • One Solution collect form web for “How to get partition ranges in SQL 2005”

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

    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
    
    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.