Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Table size help needed....

Author  Topic 

jsimmons
Starting Member

14 Posts

Posted - 2006-01-17 : 17:15:27
I am in need of assistance to determine the top 10 tables (in terms of size/rows) within a database that houses over 800 tables. Is there a DBCC command, stored procedures, or script that could provide me this information? Any help would be greatly appreciated.

Thanks....

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-01-17 : 21:30:51
Just in terms of row count rough estimates (assuming all tables have a primary key) here is a simple query:

set transaction isolation level read uncommitted
select distinct top 10 object_name(id) from sysindexes where indid < 2 order by rowcnt desc

(untested because I'm nowhere near a sql server)

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-18 : 01:11:43
In BOL, SQL Server help file, look for estimating table size

>>(untested because I'm nowhere near a sql server)

Yes that should be

select distinct top 10 object_name(id),rowcnt from sysindexes where indid < 2 order by rowcnt desc

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-01-18 : 08:29:59
This one is a little neater, and you can order by rows or size:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53843
Go to Top of Page
   

- Advertisement -