Created
May 11, 2017 11:34
-
-
Save sarangbk/205da90a909fbbd9b2f0239d0897650c to your computer and use it in GitHub Desktop.
Get row count in each user table in a Azure SQL DB
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 t.name as TableName, s.row_count as NumberofRows from sys.tables t | |
JOIN sys.dm_db_partition_stats s | |
ON t.object_id = s.object_id | |
AND t.type_desc = 'USER_TABLE' | |
AND t.name not like '%dss%' | |
AND s.index_id IN (0,1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment