Skip to content

Instantly share code, notes, and snippets.

@ArtemAvramenko
Created September 1, 2020 14:48
Show Gist options
  • Save ArtemAvramenko/a6e26bbb1ac89d9ad3477a752d51c279 to your computer and use it in GitHub Desktop.
Save ArtemAvramenko/a6e26bbb1ac89d9ad3477a752d51c279 to your computer and use it in GitHub Desktop.
SELECT
sum(ddps.row_count)
FROM sys.indexes AS i
INNER JOIN sys.objects AS o ON i.OBJECT_ID = o.OBJECT_ID
INNER JOIN sys.dm_db_partition_stats AS ddps ON i.OBJECT_ID = ddps.OBJECT_ID
AND i.index_id = ddps.index_id
WHERE i.index_id < 2 AND o.is_ms_shipped = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment