Technical Article

Count of records of all tables in current database

,

This script gives the count of records of each user table in the current database along with the table name using a single SQL Statement.  It has been tested on SQL 7 and SQL 2000

EXEC sp_MSforeachtable @command1="SELECT '?' as '[Owner].[Table]', count(*) as 'Record Count' FROM ?"

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating