码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2016-11-22 23:13:15      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:pos   select   order   sum   index   查看   desc   nbsp   type   

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

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

标签:pos   select   order   sum   index   查看   desc   nbsp   type   

原文地址:http://www.cnblogs.com/firstdream/p/6091342.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!