set nocount on
if object_id(N'tempdb.db.#temp'is not null
  drop table #temp
create table #temp (name sysname,count numeric(18))

insert into #temp
select o.name,i.rows
from sysobjects o,sysindexes i  
where o.id=i.id and o.Xtype='U' and i.indid<2

select count(count) 总表数,sum(count) 总记录数 from #temp
select * from #temp order by count desc
set nocount off

 

转自:http://www.cnblogs.com/neekerss/archive/2011/03/24/1994005.html

posted on 2012-04-12 10:35  Erich  阅读(201)  评论(0编辑  收藏  举报