统计SqlServer每张表内的数据量

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

原文地址:https://www.cnblogs.com/feihusurfer/p/5245568.html