ITPub博客

首页 > 数据库 > SQL Server > 查看TRP开头的数据量超过1000000的表的index情况

查看TRP开头的数据量超过1000000的表的index情况

原创 SQL Server 作者:o0yuki0o 时间:2018-01-22 17:56:25 0 删除 编辑

点击(此处)折叠或打开

  1. select a.name as tabname
  2.        ,h.name as idname
  3.     ,rr.row_num as rownum
  4. from sys.objects as a
  5. right join sys.indexes as h
  6.        on a.object_id=h.object_id
  7. join ( select a.name as tbname,max(b.rows) as row_num
  8.                 from sysobjects a ,sysindexes b
  9.                 where a.id=b.id and a.xtype='u' and a.name like 'TRP%'
  10.        group by a.name
  11.        ) rr
  12. on a.name=rr.tbname
  13. where a.type<>'s' and a.name like 'TRP%' and rr.row_num>1000000
  14. order by rr.row_num desc
  15.  go


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16131092/viewspace-2150408/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-02-26

  • 博文量
    90
  • 访问量
    75885