Returns the partition ID of the specified data or index partition name.
partition_id(table_name, partition_name[,index_name])
select partition_id("testtable", "testtable_ptn1")
select partition_id("testtable", "testtable_clust_ptn1", "clust_index1")
select partition_id("mydb.dbo.testtable", "testtable_clust_ptn1", "clust_index1")
You must enclose table_name, partition_name and index_name in quotes.