Technical Article

Count of records of all tables - better one

,

This script gives the count of records of each user table in the current database along with the table name.

This script eliminates the need of going through all the tables and counting them.

Works on SQL 2000 (For SQL 7.0 - use 'rows' instead of rowcnt).

/* Meir Dudai - 2002-5-9 - meir@srl.co.il */select o.name as "Table Name",i.rowcnt as "Row Count"
from sysobjects o, sysindexes i
where i.id = o.id
and indid in(0,1)
order by o.name

Rate

5 (2)

You rated this post out of 5. Change rating

Share

Share

Rate

5 (2)

You rated this post out of 5. Change rating