Home Forums Article Discussions Article Discussions by Author Discuss content posted by Sudhir Chawla Get Record count of all tables of current database RE: Get Record count of all tables of current database
mickabe
SSC Rookie
Points: 26
More actions
January 29, 2009 at 2:10 pm
#935067
Ok for small db's but this is lightning quick and avoids cursors/looping...
select o.name, i.rows
from sys.sysobjects o with (nolock)
join sys.sysindexes i with (nolock)
on o.id = i.id
where i.indid < 2
order by i.rows desc, o.name
http://msdn.microsoft.com/en-us/library/ms190283.aspx