If you have a partitioned table or index in SQL Server, and you want to determine which partition a given value would be mapped to, you can do this nice and quickly with the $PARTITION
system function.
All you need to know is the name of the partition function (and of course, the value you’re interested in).
Continue reading