获取每个表的记录数?

问题描述:

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

如何才能简单有效?帮我。

试试这个:

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

+0

它不工作。我正在使用SQLSERVER。 – Venkat 2011-04-08 14:00:24

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