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 TableName DROP TABLE #temp
posted @ 2017-03-05 00:00  PhilXu  阅读(176)  评论(0编辑  收藏  举报