MS SQL Tables and Row Counts

Run the query below in SSMS to view the tables and their row counts:

USE DB_name GO SELECT ( as tablen, ( as scheman, max(p.rows) as rows FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.tables AS t WITH (NOLOCK) ON p.[object_id] = t.[object_id] INNER JOIN sys.schemas AS s WITH (NOLOCK) ON s.[schema_id] = t.[schema_id] GROUP BY, ORDER BY,