sql server - SSIS - Derived Column Calculation Error -


having few issues calculation in derived column in ssis.

i trying perform following calculation -

4206 + ((4206 * 4206) * 0.000150000000000) + ((4206 * 4206 * 4206) * 0.000000010000000) 

i getting error of -

**the magnitude of result of binary operation overflows maximum size result data type** 

pasting calculation c# web application caused similar issue -

**the operation overflows @ compile time in checked mode**  

it complaining section - 4206 * 4206 * 4206. can resolved in web application changing 4206 * 4206 * 4206l, have no idea how resolve in ssis package.

has come across issue before? ideas appreciated.

thanks in advance.

edit

overflow exception resolved, old , new calculations returning different values, e.g. using 415 input value instead of 4206 -

old calculated value = 419.014582 new calculated value = 419.042100

the exact calculation -

old - inputvalue + ((inputvalue * inputvalue) * (dt_decimal,20)@[user::squaredvalue]) + ((inputvalue * inputvalue * inputvalue) * (dt_decimal,20)@[user::cubicvalue])

new - inputvalue + (((dt_decimal,20)@[user::squaredvalue] * inputvalue * inputvalue)) + (((dt_decimal,20)@[user::cubicvalue] * inputvalue * inputvalue * inputvalue))

edit

2nd issue around slight differences in calculation opened new question.

why not change

((4206 * 4206 * 4206) * 0.000000010000000) 

to

(0.000000010000000 * 4206 * 4206 * 4206) 

to avoid such big numbers in internal row calculation. i'd use

4206 + (0.00015 * 4206 * 4206) + (0.00000001 * 4206 * 4206 * 4206) 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

javascript - Backbone.js getting target attribute -

html - Repeat image to extend header to fill screen -