Microsoft SQL Server 2005
Performance Tuning
Best Practices

How to count rows in all tables quickly?

 

Execute the following script to execute the "SELECT count(*)" for each table in the database:

use AdventureWorks
go

sp_MSforeachtable @command1=" select TableName='?', Rows=count(*) from ?"
go

 

 

The Best SQL Server 2005 Training in the World
 
 
SQLUSA.com Home Page