Arithmetic overflow

  • Could somebody help me, an application give

    following message:

    [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error for data type smallint, value = 32768

  • quote:


    Could somebody help me, an application give

    following message:

    [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error for data type smallint, value = 32768


    the value you are trying to assign to a smallint is bigger than 32767, which is the maximum for this one. Change it to INT

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • From SQl Books on Line:

    ----

    int, bigint, smallint, and tinyint

    Exact number data types that use integer data.

    bigint

    Integer (whole number) data from -2^63 (-9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.

    int

    Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647). Storage size is 4 bytes. The SQL-92 synonym for int is integer.

    smallint

    Integer data from -2^15 (-32,768) through 2^15 - 1 (32,767). Storage size is 2 bytes.

    tinyint

    Integer data from 0 through 255. Storage size is 1 byte.

    ------

    The Number 32768 is too large for the smallint datatype as it can only store numbers up to 32767. Will need to change it to an Int datatype.

    Depending on where you are getting this error, it may mean a table column datatype change, and/or SP parameter...

  • thanks to all, that seems to be the solution

    :=)

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

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