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