SQL SERVER 查询所有数据表名称和数据行数

SELECT
 a.name,
 b.rows
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

posted @ 2019-03-14 11:04  HalleyZ  阅读(318)  评论(0编辑  收藏  举报