Monday 11 April 2011

How to find table count of all tables in a database in sql

How to find table count of all tables in a database


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