SSIS Contitional Split transformation Data types DT_WSTR and DT_I4 are incompatible

I am importing the values for field Atype from a .csv file as DT_STR, 13 and I need to fit them into a bit type CType field. When I write the conditional split ((ISNULL(Atype)?"a":Atype)!=(ISNULL(CType)?"9":CType)) it says that the DT_WSTR and DT_I4 types are incompatible and that I need to explicitly cast with a cast operator. I haven't been able to make it work, can someone please show me how to explicitly cast?

TIA

August 24th, 2015 6:12pm

So Atype is a (DT_STR, 13) and CType is a (DT_BOOL)? If I've misread that, what are the types? And what is the full error message?
Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 6:46pm

Thank you so much Ryan for looking into is, yes it was DT_BOOL. on the database side and I had changed it to DT_I4 in a data conversion.

I decided to cast it in the query in the lookup transformation and that worked.

I will still have to learn how to cast in the conditional split eventually though. So if you have the answer, I would really appreciate it.

August 24th, 2015 7:11pm

So what is it you are trying to achieve? A DT_BOOL can only be true or false (non-zero for true or 0 for false) and you're attempting to compare to a string.

To cast within the Conditional Split is just a case of wrapping the value in a cast

(DT_STR,13,1252)(ISNULL(CType)?"9":CType)

but this will give the string of either "True" or "False" which I can't believe is what you're attempting to achieve

Free Windows Admin Tool Kit Click here and download it now
August 24th, 2015 10:41pm

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

Other recent topics Other recent topics