November 16, 2006 at 11:41 pm
Hi There,
Is there any quick way to get table row counts of each database within an instance? Any suggestions will be appreciated.
Thanks in advance!
November 17, 2006 at 1:49 am
Try this script
USE NORTHWIND
SELECT sysindexes.rows, sysobjects.name
FROM sysusers, sysobjects, sysindexes
WHERE sysusers.uid = sysobjects.uid and sysindexes.id = sysobjects.id and sysobjects.name not like '#%'
and OBJECTPROPERTY(sysobjects.id, N'IsMSShipped') <> 1 and OBJECTPROPERTY(sysobjects.id, N'IsSystemTable') = 0
ORDER BY INDEXPROPERTY(sysindexes.id, sysindexes.name, N'IsStatistics')
It gives each table row count in a given database.
--Mahesh
November 17, 2006 at 2:14 am
THis query should help you.
Exec sp_MSforeachdb 'select name,rowcnt from ?..sysindexes where id in (select object_id(name) from ?..sysobjects where xtype =''u'') and status = 0'
------------
Prakash Sawant
http://psawant.blogspot.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply