SQL查询数据库中所有表的记录条数
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
转载自http://blog.csdn.net/yuanhong55/article/details/14434477
浙公网安备 33010602011771号