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)
 Database Informations

Author  Topic 

joni
Yak Posting Veteran

50 Posts

Posted - 2007-01-09 : 13:25:25
Hi Gurus,

I need to know any informations about my database like size, free space, etc... Where can I find this informations?

Thanks,

Joni

Kristen
Test

22859 Posts

Posted - 2007-01-09 : 13:28:55
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

and maybe:

http://www.databasejournal.com/scripts/print.php/1450801

Kristen
Go to Top of Page

joni
Yak Posting Veteran

50 Posts

Posted - 2007-01-09 : 13:39:57
Thanks Kristen.....
Go to Top of Page

thecoffeeguy
Yak Posting Veteran

98 Posts

Posted - 2007-01-09 : 13:55:43
quote:
Originally posted by Kristen

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

and maybe:

http://www.databasejournal.com/scripts/print.php/1450801

Kristen



This is going to sound incredibaly newbish (but I am!)...but if I wanted to run the second script for example, looks like I need to change a few things? That right?

or do I just select the DB and let her rip?

Thanks.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-01-09 : 14:21:58
"looks like I need to change a few things?"

Don't think so.

Make sure you are in the right database, then just execute the script

It creates a Temporary Table

Cursor's round all the Table names

For each table inserts into Temp Table the Size info (from the system stored procedure sp_SpaceUsed)

and then it outputs the data from the Temp Table twice - first resultset sorted by Size, second by Table Name

I used to use the second one (well, a variation of it) until MVJ wrote his (the first one), and now I use a variation of that instead (I've added an ORDER BY parameter (for any of: 'ROWS' 'TOTAL SIZE' 'DATA SIZE' 'INDEX SIZE' 'UNUSED SIZE' 'ROW AVERAGE' 'DATA AVERAGE' 'INDEX AVERAGE' 'UNUSED AVERAGE' 'DATA PERCENT' 'INDEX PERCENT' 'UNUSED PERCENT' 'NAME')

Kristen
Go to Top of Page
   

- Advertisement -