RE: Rowcounts in sql server

RE: Rowcounts in sql server

 

  

This one line code should work but it might be a drag.

exec sp_msforeachdb 'exec sp_msforeachtable ''select count(*) from ?'''

The procedures used here are undocumented, microsoft internal
procedures.

John

-----Original Message-----
From: Chip Smith [mailto:[Email Address Removed]
Sent: Friday, November 21, 2003 1:57 PM
To: LazyDBA.com Discussion
Subject: Rowcounts in sql server


I want to count all of the rows for all of the user tables in all of the
databases, one at a time. Can this be done from within sql server or do
I
need seperate procs for each db.
There are many db's.

TIA

-- chip
MS Sql Server LazyDBA home page