Check Used Table Space for User Defined Tables

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

  • 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

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

    Many Thanks

  • 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?

  • 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

  • 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?

  • 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

  • Thanks for the script.

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

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