Script task in SSIS

  • Hi,

    We are in the process of converting legacy DTS packages to SSIS. we have some script like this :

    If trim(DTSSource(col1)) = "" then

    DTSDestination(DestCol) = null

    DTSDestination(errorcode) = "1"

    else

    DTSDestination(DestCol) = trim(DTSDestination(DestCol))

    I am re-writing like this:

    trim(Row.col1) = "" then

    Row.DestCol_isnull = true

    Row.errorcode = "1"

    else

    Row.col1 = trim(Row.col1)

    But, this is not writing NULL to the column, writing just nothing to the column. I want to see NULL in my columns. How do I achive this using script ?

    Thank for the help!!

    -V

  • True NULLs frequently show up as "nothing" and you shouldn't change that. If you want to see the word 'NULL', then write a SELECT that changes null values to the word 'NULL'.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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