Results 1 to 8 of 8

Thread: SQL Server Precision Scale

  1. #1

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    SQL Server Precision Scale

    If a field is an integer in SQL Server with the precision scale set to 4, what is the largest number it can hold?

  2. #2
    Fanatic Member skald2k's Avatar
    Join Date
    Feb 2002
    Location
    Sydney, Australia
    Posts
    535
    9999
    - If at first you dont succeed, then give up, cause you will never will!

  3. #3
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Integers: (-2,147,483,648) - (2,147,483,647) (same as VB Long)
    SmallInt: (-32768) - (32767) (same as VB Integer)
    TinyInt: (0) - (255)
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  4. #4

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Who's right?

  5. #5
    DeadEyes
    Guest
    A length of 4 means 4 bytes so numbers from -2,147,483,648 through 2,147,483,647. is right

  6. #6

    Thread Starter
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Well done Scald2k
    MSDN

  7. #7
    DeadEyes
    Guest
    boy is my face red, while being technically right about the length i should really learn to read the questions

  8. #8
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    From MSDN:

    For example, an int data type can hold 10 digits, is stored in 4 bytes, and does not accept decimal points. The int data type has a precision of 10, a length of 4, and a scale of 0.
    You can't change the precision, length or scale of an Integer in SQL Server... can you?
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

Posting Permissions

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



Click Here to Expand Forum to Full Width