November 29, 2011 at 6:25 pm
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
November 30, 2011 at 9:59 am
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
November 30, 2011 at 10:49 am
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
November 30, 2011 at 1:11 pm
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