1SELECT
2 QUOTENAME(SCHEMA_NAME(sOBJ.schema_id)) + '.' + QUOTENAME(sOBJ.name) AS [TableName]
3 , SUM(sPTN.Rows) AS [RowCount]
4FROM
5 sys.objects AS sOBJ
6 INNER JOIN sys.partitions AS sPTN
7 ON sOBJ.object_id = sPTN.object_id
8WHERE
9 sOBJ.type = 'U'
10 AND sOBJ.is_ms_shipped = 0x0
11 AND index_id < 2 -- 0:Heap, 1:Clustered
12GROUP BY
13 sOBJ.schema_id
14 , sOBJ.name
15ORDER BY 2 desc
16GO