Search code examples
sql-serverssisderived-column

Data type mismatch in derived column SSIS 2010


I am trying to check data on the products table which has a column of discontinued item i.e. 1 is true and 0 is false. I am using a derived column to output the result in the staging table to YES for 1 or NO for 0. However, when it comes to linking the discontinued column in the lookup it throws an error of data type of mismatch! Discontinued data type in the source table and the staging table is the same i.e. BIT.

This is the expression I used in the derived column:

(Discontinued == (DT_BOOL)"False" ? "NO" : "YES")   

This is the error when joining the derived column DiscontinuedCheck to Discontinued

enter image description here


Solution

  • "TRUE" or "NO" or whatever is not boolean. You should be fine simply mapping the two Discontinued columns without a derived column. mapping 0 or 1 to a bit column should work fine.