Check Used Table Space for User Defined Tables

  • hkuldeep123

    Newbie

    Points: 7

    Comments posted to this topic are about the item Check Used Table Space for User Defined Tables

  • Charles Kincaid

    SSChampion

    Points: 13593

    Great script. Thanks. I learned that all bets are off when change tracking is on. I had an express instance that reported full but space used showed not enough to account for it. Turned change tracking off (did not need it anyway) and things were fine. On my "to do" list is coming up with something to show the space used by change tracking.

    ATBCharles Kincaid

  • hkuldeep123

    Newbie

    Points: 7

    Yes. that would be really useful. Do keep us posted.

    Many Thanks

  • Mick Opalak

    SSCommitted

    Points: 1629

    Nice script, but can't you get the same information in Management Studio just by listing a database's tables in the Object Explorer and sorting by space used?

  • Charles Kincaid

    SSChampion

    Points: 13593

    Mick Opalak (9/5/2012)


    Nice script, but can't you get the same information in Management Studio just by listing a database's tables in the Object Explorer and sorting by space used?

    That might have been somthing that you can do in 2000 or earlier, I don't remember, but not in 2005 or 2008.

    ATBCharles Kincaid

  • zaheer.azmat

    Newbie

    Points: 7

    Hi

    I Seem to get the following error :

    Msg 137, Level 15, State 1, Line 1

    Must declare the scalar variable "@CNT".

    i just copied and pasted into my sql server 2005?

  • Charles Kincaid

    SSChampion

    Points: 13593

    I just tried it again on my 2005 instance. Works fine for me but I do get that error if I don't have the following declare at the top.

    DECLARE

    @TABLENM SYSNAME,

    @CNT INT,

    @TOPN INT

    It can be tricky doing the copy and paste thing. I know because it has happened to me a lot.

    ATBCharles Kincaid

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script.

Viewing 8 posts - 1 through 8 (of 8 total)

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