使用目的:方便做统计 或 查询哪个表压力较大从而进行优化等功能。
USE [库名] SELECT a.name, b.rows FROM sys.sysobjects AS a INNER JOIN sys.sysindexes AS b ON a.id = b.id WHERE (b.indid IN (0, 1)) AND (a.type = 'u') ORDER BY b.rows DESC
结果:
使用目的:方便做统计 或 查询哪个表压力较大从而进行优化等功能。
USE [库名] SELECT a.name, b.rows FROM sys.sysobjects AS a INNER JOIN sys.sysindexes AS b ON a.id = b.id WHERE (b.indid IN (0, 1)) AND (a.type = 'u') ORDER BY b.rows DESC
结果: