views:

25

answers:

2

I ran the command:

EXEC sp_spaceused

The output was: alt text

So what is the size of my database? Is it - 4768.25 - 4076.57 = 691.68 MB (1st table)

OR

19896 KB (2nd table)?

EDIT

I'm using SQL Server 2005 Express which has a "database size" limit of 4 GB. So in this context of "database size", if I were to calculate how far up to the space limit I am - I should consider the unallocated space as what my database can still use?

+2  A: 

Your database size is 4768.25MB

SQL Server will allocate a database file bigger than the currently used space. This unallocated space is filled up until the database file needs to be 'grown' again

Mitch Wheat
+1 ...Just to add a bit to this - database_size ie. 4768.25 will always be larger than the sum of reserved + unallocated space because it includes the size of log files, but reserved and unallocated_space consider only data pages.
InSane
@InSane: thanks. I was glossing over the details!
Mitch Wheat
I'm using SQL Server 2005 Express which has a "database size" limit of 4 GB. So in this context of "database size", if I were to calculate how far up to the space limit I am - I should consider the unallocated space as what my database can still use?
SaM
and by the way, what is the 19.896 MB part?
SaM
@sAM: pls ignore.
Mitch Wheat
what? sorry didn't get that...
SaM
+1  A: 

To just add on to Mitch's answer in response to the edit you have posted :-

Unallocated space is the space that is not yet allocated to any database objects.

So, yes, i would consider 4076.57 MB as the space that your current database with total size of 4768.25 still has available for its use.

However, do note that this space is not just for your actual data. This space includes any and all space used by ANY database object like data,index,IAM (Index Allocation Map) pages, GAM (Global Allocation Map) pages, SGAM (Shared Global Allocation Map), or PFS (Page Free Space) pages

InSane