Get rowcount for each table

Posted by Zafar Iqbal on Friday, February 09, 2007 - 00:31

If you want to find row count for each table in your database without naming any table then use following script:

exec sp_MSforeachtable 'select count(*) as nr_of_rows, ''?'' as table_name from ?'

Leave a Reply