SP_SPACEUSED

  • Can someone please explain me why the output of  "sp_sapceused @udateusuage=true" does not match the following logic

    Database Size = Reserved + UnallocatedSpace.

    I try several people and read around 50 articles still do not have an answer

    Thanks

    Amit


    Kindest Regards,

    Amit Lohia

  • Plus the log size of database.

  • If you want to see how it's calculated, run in QA text mode:

    use master
    exec sp_helptext sp_spaceused

    Julian Kuiters
    juliankuiters.id.au

  • sp_spaceused is known to sometimes be inaccurate

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • SP_SPACEUSED does report incorrect results.  To correct the results you could execute it with the update option enabled

    sp_spaceused @updateusage = 'TRUE'

    It does generate locks in the database so only run it when the user connectivity is very low. 

    David Bird

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply