Technical Article

Display Row Count for all Tables

,

This short and simple script is a very fast way to count the rows in all your indexed tables.  I ran it against a 2-gigabyte database containing large tables (some with over a million rows!), and it returned results in under a second.

SELECTo.name, i.[rows]
FROMsysobjects o 
INNER JOIN
        sysindexes i 
ON o.id = i.id
WHERE(o.type = 'u') AND (i.indid = 1)
ORDER BY o.name

Rate

4.33 (3)

You rated this post out of 5. Change rating

Share

Share

Rate

4.33 (3)

You rated this post out of 5. Change rating