Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2003
    Posts
    176

    Unanswered: sql table storage

    How should i know size of the table in the DB. suppose my DB has 5 tables and the size of the DB is 500 MB. How can I know size of the indivdual table.

    Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd use sp_spaceused and provide it with the name of the object of interest.

    -PatP

  3. #3
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    i'd enable the taskpad in enterprise manager for whatever database that i wanted to see table size in, and then i would click the table info link at the top of the details pane. in the taskpad.

    (expand databases > right click the db you want to view and select view> taskpad)

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Hmmm, that's what sp_spaceused does, and it gets fired every time you do this mouse-click excersise
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    Dec 2002
    Location
    Sunny Florida
    Posts
    121
    And that taskpad is a PITB to scroll through.

  6. #6
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    I would capture the results of the following query to a table:

    Code:
     
    USE msdb  --  or database name of your choice
    set nocount on
    exec sp_msforeachtable @command1 = "sp_spaceused'?'"

    -- This is all just a Figment of my Imagination --

  7. #7
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •