Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Arithmetic overflow error for type int

Author  Topic 

SherinEliz
Starting Member

5 Posts

Posted - 2006-09-16 : 02:04:57
i have to calculate
power(2,32) in SQL Server Enterprise Manager.
here 32 is obtained through a series of calculations. no problem there. Error is in calculating power.
I am getting the foll error
Arithmetic overflow error for type int value = 4294927696.00000000
i tried convert(bigint,power(2,32)) but no use since conversion will anyway take place only after power is calculated which again gives the same error.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-09-16 : 04:25:03
try
power(2.0, 32.0)



KH

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-09-16 : 04:29:50
POWER(CONVERT(bigint, 2), 32)

should do the trick.

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-09-16 : 08:20:52
>>convert(bigint,power(2,32))

Note that convertion will happen only after powering the number

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -