Fetch Row Count for All Tables in a SQL SERVER
Using a short query we can list all the tables in the database along with the number of records in each table.
commit 498f334 · authored · 1 min read
Just execute the below query in the database to see the list of tables and number of records in each table.
SELECT t.name, s.row_countFROM sys.tables t JOIN sys.dm_db_partition_stats sON t.object_id = s.object_id AND t.type_desc = 'USER_TABLE' AND s.index_id IN (0,1)