获取每个表的记录数?
答
试试这个:
SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '{database}';
答
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
它不工作。我正在使用SQLSERVER。 – Venkat 2011-04-08 14:00:24