Arithmetic Overflow Error Converting Expression To Float

  • Hello all,

    I have a SSIS package which takes data from a View and updates a table from it. I can run the view without problems but receive the "Arithmetic Overflow Error Converting Expression To Float" when attempting to update the table. The datatype for the column in question is the same on both the view and the table so I cannot figure out the problem.

    Here's what I have:

    Columns:

    Distance - Int

    Interval - numeric(18,0)

    Exponent - numberic(18,4)

    Multiplier - numberic(18,4)

    These 4 values derive a column called Distance_Factor which is numeric(38,6)

    Here is the code which creates Distance_Factor:

    (CASE WHEN (([Multiplier] * Power(((([Distance] / [Interval]) * [Interval]) + [Interval]) , [Exponent])) > [Max_Value]) THEN ([Max_Value]) ELSE ([Multiplier] * Power(((([Distance] / [Interval]) * [Interval]) + [Interval]) , [Exponent])) END)

    I don't know how FLoat even enters the picture, as these are all defined data types. Additionally, this does run in the View (takes forever) but won't update the table. I've triple checked the table and the column data type for it matches that in the view of numeric(38,6).

    Any idea as to why I am getting the float error? Any suggestions to alleviate this issue? This exact code worked two days ago. The only difference now is that we are hitting it with quite a few more records.

    Thanks in advance!

  • Hi Robert,

    What type does [Max_Value] have?

    Is it possibly a float?

    Since you are comparing the (non-float) calculated value with [Max_Value] (possibly float), one of the values must change data-type for the comparison. My guess is that the calculated value is converted to float before the comparison. And now you have new data in the table for which the calculated value does not fit into a float variable...

    Try casting [Max_Value] to for instance NUMERIC(38,6)...

    /Markus

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply