Sql Server 查询库表记录数

CREATE TABLE #temp (TableName VARCHAR (255), RowCnt INT)
EXEC sp_MSforeachtable 'INSERT INTO #temp SELECT ''?'', COUNT(*) FROM ?'
SELECT TableName, RowCnt FROM #temp ORDER BY 2 desc
DROP TABLE #temp
原文地址:https://www.cnblogs.com/tohen/p/3710839.html