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

 

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

 

posted @ 2020-06-23 14:32  余路还要走多久  阅读(594)  评论(0编辑  收藏  举报