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

  • create table #t (i int)

    EXEC sp_MSForEachTable 'insert into #T select count(*) from ?'

    select sum(i) from #t