how to know the size in bytes of a record in a table

  • Hi!

    I am trying to find out what will be the growing of my database, I will have like 300,000 transaction per day in one of the tables and I need to know what is the size of one record of the table to make an estimated.

    Is there a query to do that?

     

  • you can add the maximum sizes of the different datatypes  and that will give you a maximum record size.

    If you already have the table created and some data in it you can try:

    dbcc showcontig ( 'Table_name' ) with tableresults

     

    Then have a look at:

    MinRecSize, MaxRecSize, AvgRecSize

     

    For a conservative approach use MaxRecSize

     

    Cheers,

     


    * Noel

  • Gracias!

    Thank you so much!

  • De nada!

    You're welcome

     


    * Noel

  • Different slant...

    EXEC sp_SpaceUsed yourtablenamehere

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Well, I guess that you can use that, and then use  data/rows to get the avgbytes per records

    Good Call

     

     


    * Noel

  • Thanks!

  • Noeld,

    Thanks... The reason I suggested it is that it doesn't look like the DBCC command accounts for index size or reserved space.  Do you know if it does or is it only record size that it accounts for?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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