[SQL]获取数据库所有表行数占用 2017-09-122017-09-12 • SQL • 评论关闭 • Aar0n •2,067 次查阅 获取数据库所有表行数占用,闲话少说上码。 SELECT a.name 表名 , b.rows 记录数 ,rtrim(8*b.dpages)+'Kb' 占用, FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id WHERE (a.type = 'u') AND (b.indid IN (0, 1)) ORDER BY a.name,b.rows DESC