SQL Quick Row Count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT so.name as TableName, ddps.row_count as [RowCount] | |
FROM sys.objects so | |
JOIN sys.indexes si ON si.OBJECT_ID = so.OBJECT_ID | |
JOIN sys.dm_db_partition_stats AS ddps ON si.OBJECT_ID = ddps.OBJECT_ID AND si.index_id = ddps.index_id | |
WHERE si.index_id < 2 AND so.is_ms_shipped = 0 | |
ORDER BY ddps.row_count DESC | |
-- https://ignas.me/tech/sql-quick-row-count/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment