Space used by a table

  • Is there a way to figure out the space used by a table in the last month?

  • sunny.tjk (8/17/2011)


    Is there a way to figure out the space used by a table in the last month?

    You'll need to be more precise what you're looking for.

    "Table space used in a month" cannot really be calculated. What would you expect if the table went from 10Mb to 1Gb during some data import immediately followed by a delete and a release of unused space that brought it back down to 15Mb?

    What would be your expected result for such a scenario?

    Would you include all related non-clustered indexes as well since those are part of the table?

    You could run EXEC sp_spaceused N'yourSchema.YourTable'; at scheduled times to collect the table size at this point in time. Based on that you could perform some calculation. But those figures can be wrong.... (I could rebuild the indexes just before those measures are taken and allow it to grow again after that...)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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