Home Forums SQL Server 7,2000 Administration Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname RE: Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname
Kelley Fitz
SSC Enthusiast
Points: 134
More actions
May 4, 2015 at 9:08 am
#1795378
The ? is the table name
EXEC MSFOREACHTABLE 'SELECT COUNT(*) AS ''?'' FROM ?'
TABLENAME
COUNT