I did not Know this SP but i have used your ideia and fix to my needs tks Carlos Lages
use pubs go create table #rowcount (tablename varchar(128), rowcnt int) exec sp_MSforeachtable 'insert into #rowcount select ''?'', count(*) from ?' select top 5 * from #rowcount order by tablename drop table #rowcount