欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

SQL SERVER查询数据库所有表的大小,按照记录数降序排列

程序员文章站 2022-07-09 20:16:26
SELECT B.NAME,A.ROW_COUNT FROM SYS.DM_DB_PARTITION_STATS A,SYS.OBJECTS BWHERE A.OBJECT_ID=B.OBJECT_ID AND A.INDEX_ID<=1AND B.TYPE='U'AND A.ROW_COUNT>8 ......

select b.name,a.row_count from sys.dm_db_partition_stats a,
sys.objects b
where a.object_id=b.object_id
and a.index_id<=1
and b.type='u'and a.row_count>8000
  order by  row_count  desc