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
 Transact-SQL (2000)
 SQL table size

Author  Topic 

JeffS23
Posting Yak Master

212 Posts

Posted - 2007-12-27 : 12:23:17
How do I export or create a list of the SQL table sizes. I need to know what tables have data in them.
What is the best way to do this?

nr
SQLTeam MVY

12543 Posts

Posted - 2007-12-27 : 12:44:26
select object_name(id), rows from sysindexes where id <= 1


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

JeffS23
Posting Yak Master

212 Posts

Posted - 2007-12-28 : 12:34:15
Your script just told me how many tables had data in them. I need to know what tables have data in them, and I don't really care how much data. Do you have something that will tell me what I need to know?
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2007-12-28 : 12:47:09
I think he meant this:
select object_name(id), rows from sysindexes where indid <= 1

you can leave off the [rows] column if you don't care for that info.

Be One with the Optimizer
TG
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-12-28 : 13:13:25
This script will give you the information you want.

Script to analyze table space usage
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -