Last active
March 10, 2016 14:40
-
-
Save vgashic/5564535 to your computer and use it in GitHub Desktop.
All tables row count (SQL Server)
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 SUBSTRING(obj.name, 1, 50) AS Table_Name | |
,ind.rows AS Number_of_Rows | |
FROM sysobjects AS obj | |
INNER JOIN sysindexes AS ind ON obj.id = ind.id | |
WHERE obj.xtype = 'U' | |
AND ind.indid < 2 | |
AND ind.rows > 0 | |
ORDER BY obj.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment