获取表的记录行数
SELECT t.name,p.rows FROM sys.indexes AS i
INNER JOIN sys.tables AS t ON i.object_id = t.object_id
join sys.partitions p with(nolock) on i.object_id = p.object_id AND i.index_id = p.index_id
WHERE i.type_desc = 'CLUSTERED'
ORDER BY p.rows
INNER JOIN sys.tables AS t ON i.object_id = t.object_id
join sys.partitions p with(nolock) on i.object_id = p.object_id AND i.index_id = p.index_id
WHERE i.type_desc = 'CLUSTERED'
ORDER BY p.rows