T
T
Today I learned
Search…
Get row count for all tables in database
If you want to get an idea of how many rows of data are in your tables in your database, connect to the database and run this query:
1
SELECT t.name, s.row_count from sys.tables t
2
JOIN sys.dm_db_partition_stats s
3
ON t.object_id = s.object_id
4
AND t.type_desc = 'USER_TABLE'
5
AND t.name not like '%dss%'
6
AND s.index_id IN (0,1)
Copied!
Last modified 2yr ago
Copy link