方法一:

select a.name,b.rows from sysobjects as a,sysindexes as b 
where a.type='u' and a.id=b.id and b.indid in(0,1)
order by b.rows desc

方法二:

CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)
EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'

select * from #temp order by RowCnt desc
DROP TABLE #temp

 

 posted on 2019-04-19 10:06  会飞的金鱼  阅读(1025)  评论(0)    收藏  举报