SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Arithmetic overflow error for type int
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SherinEliz
Starting Member

5 Posts

Posted - 09/16/2006 :  02:04:57  Show Profile  Reply with Quote
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)

Singapore
17587 Posts

Posted - 09/16/2006 :  04:25:03  Show Profile  Reply with Quote
try
power(2.0, 32.0)



KH

Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 09/16/2006 :  04:29:50  Show Profile  Reply with Quote
POWER(CONVERT(bigint, 2), 32)

should do the trick.

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22744 Posts

Posted - 09/16/2006 :  08:20:52  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
>>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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000