Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Posts
    94

    Unanswered: bigint - Arithmetic overflow

    Hi,

    I am getting

    Server: Msg 232, Level 16, State 3, Line 1
    Arithmetic overflow error for type int, value =
    1152921504606847000.000000.

    when I do

    select power(2,60) in query analyzer

    then I tried

    declare @b bigint
    select @b = power(2,60)

    same error.

    I tried

    select convert(bigint,power(2,60)) no luck

    Is there any way to tell sql server to use bigint when it
    calculate power(2,60)

    Ram.

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    This worked:

    declare @b bigint
    select @b = power(cast(2 as bigint),60)
    select @b

    --------------------
    1152921504606846976

    (1 row(s) affected)

  3. #3
    Join Date
    Nov 2002
    Posts
    94
    Originally posted by rdjabarov
    This worked:

    declare @b bigint
    select @b = power(cast(2 as bigint),60)
    select @b

    --------------------
    1152921504606846976

    (1 row(s) affected)

    much thanks !!!!!

Posting Permissions

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