December 2008 Blog Posts

Partition Details and Row Counts

You will likely find the following query useful if you work with partitioned objects.  I developed this when I first started using table partitioning in order to verify proper partition boundaries, filegroups and row counts.  Not only does this provide much more information that can be obtained by querying the underlying table with the partition function to get partition numbers, it runs much faster because only catalog views are used. As-is, the query includes both partitioned and non-partitioned user objects in the context database but you can customize the WHERE clauses as desired.  I think this query would make a perfect...