SSIS datatype issue

Hi,

I m writing this column in derived column transformation

(ISNULL( [alpha_desc] )?[determinant_value]: [alpha_desc])

But since datatype of Alpha is varhcar(234) and datatype of value is float, the package is throwing an error

How to correct this error?

May 27th, 2015 7:55pm


ISNULL( [alpha_desc] ) ? (DT_STR, 50, 1252)[determinant_value] : [alpha_desc]

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2015 9:21pm

Hi SyedF,

When you add an expression (ISNULL( [alpha_desc] )?[determinant_value]: [alpha_desc])in Derived Column Transformation, you receive the error message The data types "DT_R8" and "DT_WSTR" are incompatible for the conditional operator. After testing the issue in my environment, I can reproduce it.

As per my understanding, the issue should be caused by the following reason: the [determinant_value] column with DT_R8 data type, while [alpha_desc] column with DT_WSTR data type. The data types "DT_R8" and "DT_WSTR" are incompatible for the conditional operator.

So to fix this issue, please change the original expression to like below based on your requirement:
The derived column uses DT_R8 data type:
ISNULL( [alpha_desc] ?[determinant_value]: (DT_R8)[alpha_desc]
The derived column uses DT_WSTR data type:
ISNULL( [alpha_desc] ? (DT_WSTR,50)[determinant_value]: [alpha_desc]

If there are any other questions, please feel free to ask.

Thanks,
Katherine Xiong

May 28th, 2015 11:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics