Situation: A column containing an number is imported into SSIS as a string. We are converting the string to either an integer or decimal number based on what the data type is expected to be using the Data Conversion task. The Configure Error Output is used redirect both errors and truncation to a script task.
Problem: The SSIS Data Conversion Transformation rounds number values to fit the new data type and does not throw a conversion or truncation error. The row redirect is not happening for numbers. For example, when DT_DECIMAL (10,2) is required, but a value of 12.123 is converted, the value is rounded to 12.12 with no error or truncation redirect. I used a data viewer to verify the Data Conversion task is causing the rounding. Errors from non-numeric characters do cause the row to redirect.
Desired Output: We want to have an error thrown signaling if the data does not match the required data type, for example DT_DECIMAL (10,2).
Is there any way to not have numbers round with the data conversion task, or would another task be required to do this?
You will likely need another task, the Script Component for Data Transformation provides the most flexibility.
You will be able to customize the data conversion and error output in the code.