Hello, I am having a bit of a struggle with Expressions inside SSIS Derived Columns.
My source field is a BOOLEAN data type. It's destination field is a SQL CHAR datatype.
** Note that I did not design either of the schemas. If I had my way, the data types would match up. Unfortunately, this is not my case!
I found a great example of a .NET Regular Expression converting CHAR-to-BOOL. This does the exact opposite of what I am trying to accomplish:
[valToTranslate] == "Y" ? (DT_BOOL)1 : [valToTranslate] == "N" ? (DT_BOOL)0 : NULL(DT_BOOL)
I have tried to implement the reverse formula of this expression with no success. Here is my failing attempt:
[valToTranslate] == 0 ? (DT_WSTR,1)"N" : [valToTranslate] == 1 ? (DT_WSTR,1)"Y" : "N"(DT_WSTR)
I am not sure if the CAST to (DT_WSTR,1) is even correct for CHAR SQL datatype fields? Should I be using (DT_STR,1) instead? Any help is greatly appreciated.