SSIS Derived Columns

  • Comments posted to this topic are about the item SSIS Derived Columns

  • This was removed by the editor as SPAM

  • Easy one. It seems Steve didn't try to kill us on Friday. 😀

  • Could someone please explain why it's necessary to cast NULL(DT_STR,6,1252) to (DT_STR,6,1252)?

    Shouldn't it be possible to use the expression

    (DT_STR,6,1252)(TRIM(DepartmentID) == "" ? NULL(DT_STR,6,1252) : TRIM(DepartmentID))

    rather than

    (DT_STR,6,1252)(TRIM(DepartmentID) == "" ? (DT_STR,6,1252)NULL(DT_STR,6,1252) : TRIM(DepartmentID))

  • Stewart "Arturius" Campbell (10/22/2015)


    Nice, easy question to end the week on, thanks, Steve.

    However, the answers appear syntactically incomplete, e.g.

    The converts to NULL and ...

    should this not have rather read

    The expression converts blanks to NULL and

    Where blanks includes both empty strings and any number of spaces.

    Also, it should be 'or' (or even 'xor') rather than 'and'. Because it doesn't do any trimming in the case of a blank, it just makes it NULL.

    I was able to deduce what was meant to be the correct answer, but it is definitely in need of some cleanup.

  • Poorly worded. The expression does not "converts to NULL and removes beginning and trailing spaces", which implies that it first converts to NULL then removes the spaces -- clearly impossible since there would be no spaces to remove.

    What it does is convert empty strings to NULL and trim leading and trailing spaces from non-empty strings.

    Gerald Britton, Pluralsight courses

  • g.britton (10/23/2015)


    Poorly worded. The expression does not "converts to NULL and removes beginning and trailing spaces", which implies that it first converts to NULL then removes the spaces -- clearly impossible since there would be no spaces to remove.

    What it does is convert empty strings to NULL and trim leading and trailing spaces from non-empty strings.

    +1 I got the gist of what the answer choice was trying to say but your explanation is more accurate.

  • Nice one, thanks.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I just confusing me when using the Trim function rather than thinking about the use of Derived Columns.

    Thanks.

  • Junior Galvão - MVP (10/26/2015)


    I just confusing me when using the Trim function rather than thinking about the use of Derived Columns.

    Thanks.

    Me too

Viewing 10 posts - 1 through 9 (of 9 total)

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