Last active
December 19, 2015 13:29
-
-
Save FembotDBA/5962630 to your computer and use it in GitHub Desktop.
T-SQL Row Count of all user tables in database
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 o.name AS "Table Name", i.rowcnt AS "Row Count" | |
FROM sysobjects o, sysindexes i | |
WHERE i.id = o.id | |
AND indid IN(0,1) | |
AND xtype = 'u' | |
AND o.name <> 'sysdiagrams' | |
ORDER BY i.rowcnt DESC | |
COMPUTE SUM(i.rowcnt) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment