Using case logic in SSIS

  • HI experts,

    I have a CSV column "Withdrawal" with either TRUE or FALSE as values. The destination SQL table has a bit by design which means if its true then 1 or 0.Please help how can i apply this logic inside my package?

    Many thanks

    Regards

    T

  • I've had to deal with this before:

    CASE Withdrawal WHEN TRUE THEN 1 ELSE 0 END AS Column_Name

  • I don't know about SSIS, but SQL will automatically convert TRUE to 1 and FALSE to 0 when assigned to a bit field.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • If you're doing this during a data flow you can use the Derived Column transformation. That will also let you get it into the correct data type downstream.

  • I don't know about SSIS

    SSIS is very picky.  Just about, if not everything, has to be stated explicitly.  I'm certain I had to do the CASE statement above to bring the data from PostgreSQL.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply