• Hi,

    Why not use

    select p.[rows] from sys.partitions p

    where p.index_id in (0,1) and p.object_id = object_id('[schema].[TableName]')

    to replace count(1)?

    You already have the count for every table in sys.partitions view.

    Regards,

    IgorMi

    Igor Micev,My blog: www.igormicev.com