Sql server 2005 查询某个数据库下的所有表的记录行数
时间:2010-10-29 来源:andy_tigger
select a.name AS name,b.rows AS rows INTO #Temp1
from db_tank.dbo.sysobjects a LEFT JOIN db_tank.dbo.sysindexes b
ON( a.id=b.id ) WHERE a.type='u' ORDER BY b.rows DESC
SELECT name,max(rows) FROM #Temp1 GROUP BY NAME ORDER BY max(rows) DESC
DROP TABLE #Temp1
相关阅读 更多 +