• The line:

    MIN(row_count) AS Rows,

    Returns incorrect results for partitioned tables.

    It shoudl read:

    SUM(row_count) as Rows,

    to correctly sum the rowcount across all partitions.

    As for the exclusion of XML data, does the subquery (LOBDATA) against sys.dm_partition_stats joined to sys.internal_tables not return this metric?

    Just curious...