SQL Server sp_spaceused usage

T.Zacks 3,996 Reputation points
2021-07-13T09:07:05.617+00:00

I used this query exec sp_spaceused 'TblZipContent' then got the result like

name                  rows          reserved           data                    index_size         unused
TblZipContent     5180099        566422672 KB    566421960 KB     24 KB        688 KB

1) what is reserved column? what it is showing ?
2) what is unused column ?

please guide me. thanks

Developer technologies | Transact-SQL
0 comments No comments
{count} votes

Accepted answer
  1. MelissaMa-MSFT 24,221 Reputation points
    2021-07-13T09:26:11.52+00:00

    Hi @T.Zacks ,

    Please refer details from below:

    • reserved: space that is reserved for use by database objects =566422672 KB/1024=553174 MB
    • unused: portion of the reserved space, which is not yet used = 688 KB

    Below is the simple formulae I came up with to better interpret the results.

    • used = data + index_size
    • reserved = used + unused
    • database_size = reserved + unallocated space + log space

    You could also refer below picture.

    114189-description.jpg

    Please refer more details in this link.

    Best regards,
    Melissa


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.