• How about just using sysindexes or its modern equivalent? Sure it might be a bit dated, but broadly close enough.

    That way you don't have to load your server runnning a count over all your tables (when you start hitting billion record tables that really stings...)

    Much easier all round!