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
DROP TABLE #temp;
转载于:https://www.cnblogs.com/wxy520/p/5333447.html
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
DROP TABLE #temp;
转载于:https://www.cnblogs.com/wxy520/p/5333447.html