Issue: When converting String data type to Int using data conversion in SSIS, The transformation failing with conversion error.Source used is Excel
Cause: Excel source file contain Nulls and empty values. So because of empty string we are not able convert the values.
Solution:Add a derived column transformation and add the following expression for the derived column.
Expression: ISNULL([COLUMN_NAME]) || TRIM([COLUMN_NAME]) == "" ? (DT_I4)0 : (DT_I4)[COLUMN_NAME]
Then use this derived column in the output.
So if there is empty string or null values that will be replaced with O else with the column name.
Thank you.
Cause: Excel source file contain Nulls and empty values. So because of empty string we are not able convert the values.
Solution:Add a derived column transformation and add the following expression for the derived column.
Expression: ISNULL([COLUMN_NAME]) || TRIM([COLUMN_NAME]) == "" ? (DT_I4)0 : (DT_I4)[COLUMN_NAME]
Then use this derived column in the output.
So if there is empty string or null values that will be replaced with O else with the column name.
Thank you.
No comments:
Post a Comment