Looking for a way to list a row count for every table in a database? Look no further…

1–2 minutes

Originally from

Found, then improved from

Found, then improved

Repost

the wolf counting small rows of beans in a long row of jars, one amber jar, the raven holding a small lantern
SQL
SELECT OBJECT_NAME(OBJECT_ID) TableName, st.row_count
FROM sys.dm_db_partition_stats st
WHERE index_id < 2
ORDER BY st.row_count DESC
GO