Technical Article

TableCounts

,

This script generates a statement that you would then run in the user database to get rowcounts of all tables. The advantages of this approach are you can modify it to get just the tables you want, and the output is easy to read:
Table1
-------
1069

Table2
------
10427

use <database>
go
set nocount on
go
select 'select ' + name + ' = ' + ' count(*) from ' + name
+ char(10)
+ 'go'
from sysobjects where type = 'U'
and name not like 'sys%'
order by name
go

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating