统计MSSQL数据库中所有表记录的数量

SELECT a.name as '表名', b.rows as '记录数' 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 b.rows DESC

posted @ 2017-12-29 22:18  bingege  阅读(2114)  评论(0编辑  收藏  举报