Thursday, September 8, 2011

Count all row in all table RowCount

 Run this script to get the row counts of all tables.
 

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

No comments:

Post a Comment