首页 > 数据库技术 > 详细

sqlserver 表记录数统计

时间:2020-08-25 10:54:43      阅读:75      评论:0      收藏:0      [点我收藏+]

 

sqlserver 表记录数

select   a.name as 表名,max(b.rows) as 记录条数   from   sysobjects   a   ,sysindexes   b     
  where   a.id=b.id   and   a.xtype=‘u‘   and b.rows > 0
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 表记录数统计

原文:https://www.cnblogs.com/iwana/p/13558154.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!