您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

sqlserver 表记录数统计

bubuko 2022/1/25 19:28:48 sqlserver 字数 926 阅读 796 来源 http://www.bubuko.com/infolist-5-1.html

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 > 0group by a.name o ...

 

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


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶