Estimating Table size

  • Any one have a script to estimate the size of a table if it doesn't have data yet but you know about how many rows it will be?

  • Best way is too look at the size of each column, add the amounts (even for variable length columns) and multiply by the number of estimated rows.

    For instance

    int = 4 bytes

    char(4000) = 4000 bytes

    datetime = 8 bytes

    if you had one field of each you would have 4012 bytes per row * the number of ros you plan on. If you need help with the size opoen the table in design with EM, there is a column with that in it.

    Edited by - antares686 on 01/17/2003 5:24:24 PM

  • Do not forget that each row has an overhead of about four bytes (forgot the exact number). Also, if you have indexes, add those up.

    Some tools (ERwin is one) can help to estimate table and database size.

  • Actually there are several overheads which are added. See this thread for additional related comments.

    http://www.sqlservercentral.com/forum/topic.asp?TOPIC_ID=9366&FORUM_ID=65&CAT_ID=1&Topic_Title=NULL+Storage+Space&Forum_Title=Performance+Tuning

Viewing 4 posts - 1 through 3 (of 3 total)

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