This Blog is about MSSQL server 2000/2005 and 2008
Tuesday, July 06, 2010
sp_MSforeachtable
create table #rowcount (tablename varchar(128), rowcnt int)
exec sp_MSforeachtable 'insert into #rowcount select ''?'', count(*) from ?'
select top 5 * from #rowcount order by rowcnt desc
select * from #rowcount
drop table #rowcount
No comments:
Post a Comment