SQL Server中统计所有表的记录数

SQL Server中统计所有表的记录数:


SELECT object_name (i.id) TableName,   
       rows as RowCnt   
FROM sysindexes i   
INNER JOIN sysObjects o   
    ON (o.id = i.id AND o.xType = 'U ')   
WHERE indid < 2   
ORDER BY rows desc;
--升序ASC,降序DESC