Home > SSIS > SSIS: Returning NULL in a conditional statement

SSIS: Returning NULL in a conditional statement

October 22nd, 2007

I was working with SSIS the other day, and was trying to get to use a Derived Column Transformation to return a NULL value. It should be pretty straightforward, however it seems you have to cast the NULL expression as a NULL value for it to work properly. Rather than using simply:

TRIM(column_name) == “NULL” ? NULL(DT_STR,27,1252) : TRIM(column_name)

I instead had to use:

TRIM(column_name) == “NULL” ? (DT_STR,27,1252)NULL(DT_STR,27,1252) : TRIM(column_name)

Thanks to this blog entry for pointing me in the right direction.

Post to Twitter Tweet This Post Post to Digg Digg This Post Post to Facebook Facebook

mike SSIS

  1. stevet
    January 19th, 2010 at 16:06 | #1

    Stumbled upon this one myself. To expand on this anser, one can use the straight NULL(DT_STR,27,1252) by itself, but will have to prefix when in a conditional statement

  1. No trackbacks yet.

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.