Check Table Size and DB Size

  • Br. Kenneth Igiri

    SSCarpal Tunnel

    Points: 4522

    Comments posted to this topic are about the item Check Table Size and DB Size

    Br. Kenneth Igiri
    www.scribblingsage.com
    All nations come to my light, all kings to the brightness of my rising

  • lup328

    SSC-Addicted

    Points: 477

    While running the code to check the table size, I got this error:

    'Msg 15009, Level 16, State 1, Procedure sp_spaceused, Line 62

    The object '[dbo].[#0035E158]' does not exist in database 'tempdb' or is invalid for this operation.

  • Br. Kenneth Igiri

    SSCarpal Tunnel

    Points: 4522

    Which of th scripts did you have this error with? Check DB Size or CHeck Table Size.

    Br. Kenneth Igiri
    www.scribblingsage.com
    All nations come to my light, all kings to the brightness of my rising

  • Br. Kenneth Igiri

    SSCarpal Tunnel

    Points: 4522

    Apparently yo had this error with the Check table Size script:

    use AcsData

    go

    create table #tablesize

    (name nvarchar(120),rows char(11),reserved varchar(18),

    data varchar(18),index_size varchar(18),unused varchar(18))

    go

    insert into #tablesize

    exec

    sp_msforeachtable @command1=

    'exec sp_spaceused ''?'''

    select * from #tablesize

    go

    drop table #tablesize

    go

    You need to replace the <DB_NAME> line with an actual database. Apparently you ran the script on tempdb and objects are created and droped in this db onthe fly.

    Br. Kenneth Igiri
    www.scribblingsage.com
    All nations come to my light, all kings to the brightness of my rising

  • lup328

    SSC-Addicted

    Points: 477

    It works now. Thank you

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Thanks for the script.

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    ...and the update.

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

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