BUG: Arithmetic Overflow Error when Using the Power() Function

ID: Q231159


The information in this article applies to:
  • Microsoft SQL Server version 6.5 Service Pack 5a

BUG #: 18720 (SQLBUG_65)

SYMPTOMS

When a Power() function operates on an integer value within a multiplication or division statement, if that statement also contains a floating point value, the following error message occurs:

Arithmetic overflow occurred.
For example, the following query statement returns the error message:

select 9520.00 / power(2,4) 


WORKAROUND

  • Replace the integer value inside of the Power() function with a numeric value. For example:
    
    select 9520.00 / power(2.0,4) 


    -or-


  • Use a local variable to store the result of the power function and then use the local variable in the multiplication or division statement. For example:
    
    declare @val float
    select @val = power(2,4)
    select 9520.00 / @val 



STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5 Service Pack 5a.

Additional query words:

Keywords : kbSQLServ650sp5bug
Version : winnt:6.5 Service Pack 5a
Platform : winnt
Issue type : kbbug


Last Reviewed: May 24, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.