Mark B
Mark B

Reputation: 1

Freeing up space in SQL Server

I wonder if anyone can point me in the right direction with this please.

I have a number of tables in a SQL Server database and I have used a script to analyze the space that's being used by each table.

The script can be found here if anyone's interested: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762

My table sizes only account for about a third of the size of the database, so my question is what is using the rest of space and how can I reduce the overall database size?

Many thanks for any pointers.

Upvotes: 0

Views: 8067

Answers (2)

gbn
gbn

Reputation: 432180

Do you need to reclaim space because you have disk space problems? If not, leave it.

You are almost certain to cause issues by shrinking database and/or files:

Quoting from the last one:

Myth #9: Data file shrink does not affect performance.

Hahahahahahahahahahahahahahaha! <snort>

<wipes tears from eyes, attempts to focus on laptop screen, cleans drool from keyboard> 

Generally the database needs to be this size if it is this size based on previous auotgrows.

For example, you need free space of approximately 1.2 times your biggest table when indexes are being rebuilt. If one table is 25% of your data then this table consumes 55% during index rebuilds.

So, don't do it unless you have a severe need...

Upvotes: 3

Alterlife
Alterlife

Reputation: 6625

Assuming that this is SQL Server specific,

DBCC SHRINKDATABASE

http://msdn.microsoft.com/en-us/library/aa258287%28v=sql.80%29.aspx

Upvotes: 0

Related Questions