Sql Server 查询库表记录数时间:2023-03-09 07:19:39 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