Monday, January 19, 2009

SQL: List all Tables and its record count

This code sample shows how to list all Tables and its data Rows count


SELECT
o.name TableName ,
i.rows TblRowCount
FROM
sysobjects o INNER JOIN sysindexes i ON (o.id = i.id)
WHERE
o.xtype = 'u' AND i.indid < 2

No comments:

Post a Comment