Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get Record count of all tables of current database Expand / Collapse
Author
Message
Posted Thursday, November 6, 2008 4:23 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:11 AM
Points: 1,569, Visits: 56
Comments posted to this topic are about the item Get Record count of all tables of current database
Post #598605
Posted Thursday, January 29, 2009 2:10 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 12:20 PM
Points: 9, Visits: 115
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
Post #646392
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse