May 14, 2010 at 4:02 am
Hello,
I'm having trouble to store (24.00 * 100 / 24.00) into a numeric (15,2) column.
Even with the ROUND I run into trouble.
Create table #test
(
value1 numeric (15,2)
,value2 numeric(15,2)
,myvalue numeric(15,12)
)
insert into #test
(value1,value2)
select 24.00,24.00
update #test
SET myvalue=value1*100/value2
select *
from #test
Sqlserver 2000:
24.0024.00100.000000000000
Sqlserver 2008 sp1 Cumulative hotfix 7:
Msg 8115, Level 16, State 7, Line 11
Arithmetic overflow error converting numeric to data type numeric.
update #test
SET myvalue=round(value1*100/value2,15,2)
Arithmetic overflow error converting numeric to data type numeric.
May 14, 2010 at 10:32 am
May 14, 2010 at 12:40 pm
Thanks, I'll try uninstalling Cumulative 7 when I get approval.
May 17, 2010 at 6:27 am
It was the connection option numeric round_abort (Database Properties > Options > Numeric Round-Abort)
Would also work with end result numeric (30,18)
*Probably in combination with Cumulative hotfix 7
May 18, 2010 at 9:56 pm
Jo Pattyn (5/17/2010)
It was the connection option numeric round_abort (Database Properties > Options > Numeric Round-Abort)
That was the weirdest error I've seen in quite a while... thanks for posting what you found the problem to be.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply