SQLSERVER 数据库查看各表的记录数

 

select   a.name as 表名,max(b.rows) as 记录条数   from   sysobjects   a   ,sysindexes   b     
  where   a.id=b.id   and   a.xtype='u'   
group   by   a.name   
order by max(b.rows) desc
 

select SUM(记录条数) as 总记录数 from(
  select top 10000 a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
  where a.id=b.id and a.xtype='u'
  group by a.name
  order by max(b.rows) desc
) t1

posted @ 2016-11-22 21:56  有梦就能实现  阅读(23730)  评论(0编辑  收藏  举报