Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    176

    Unanswered: Calculating number of Bytes

    Hi,

    We are trying to get a rough estimate of the size of the warehouse in terms of number of bytes. Now I understand that when I say char(2) datatype requires 2 bytes of memory. If this is correct then how many bytes does the following data type need -

    1. smalldatetime
    2. decimal(14,2)
    3. decimal(12,2)
    4. int
    5. smallint.
    6. decimal(9,0)

    Also can you explain the byte allocation for a varchar column. Say varchar(20) for example.

    Any help is appreciated.

    Vivek

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    All of the gory details are explained in Inside SQL Server 2000 by Kalen Delaney. Once you read her chapter on table structures, you'll be able to compute exactly how much space your data will need. After you read the chapter on indexing, you'll understand exactly how much space your indicies will need. At that point, you'll also understand more than about 80% of the SQL Server users wandering the planet!

    Just as a disclaimer: Kalen is an old friend of mine, but I have no interest of any kind (particularly financial) in selling her book.

    -PatP

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Who says indicies?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Brett Kaiser
    Who says indicies?
    Me do. Why?

    -PatP

Posting Permissions

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