boolen column and convert in expression

  • I'm using a ssis package to import data from flat source file to sql table.

    One column in table is bit data type, 0, 1 reprents false and true.

    In my source file the column is called hourly with data like X means it is hourly, if it is null, it means it isnot hourly.

    I use following expression: ISNULL(Hourly) || TRIM(Hourly) == "" ? "False" : "True"

    when I run the package it seems imported the data correctly. in SSIS expression screen I see the data type is Unicode string [DT_WSTR], do I need to do some conversion to boolen here , if so how can I do that?

    Thanks

  • You might use the advanced editor and change the underlying datatype to boolean in the output. You also might need to take the quotes off the true and false..

    CEWII

  • Thanks, not sure why my original ones work too. the one not using boolen, and with '' around True, false.

    It must do some implicit conversions behind.

    But I changed according to your recommendations, it works fine.

    Thanks

  • Glad to hear it, yw.

    CEWII

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

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