获取每个表的记录数?

时间:2011-04-08 11:50:03

标签: sql-server row dbvisualizer

我有700个表,我想知道使用dbvisualizer的每个表的记录数。

怎么做简单有效?帮助我。

2 个答案:

答案 0 :(得分:0)

试试这个:

SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{database}';

答案 1 :(得分:0)

SELECT  distinct t.name, p.rows
FROM    sys.tables AS t
INNER JOIN sys.partitions AS p
        ON t.object_id = p.object_id
ORDER BY t.name