Share via

SSIS conditional derived column

Naomi Nosonovsky 8,906 Reputation points
2022-06-20T21:31:59.557+00:00

Hi everybody,

I managed to write this conditional expression in SSIS:

(LEFT([PayerID],1)!="9")?[CheckNumber]: ""

However, what I really want to return is either CheckNumber or NULL and it should be varchar (not unicode) string of 10 characters. I'm not sure how to write the correct SSIS expression to achieve the desired result. Trying to use NULL( of the correct type results in expression shown in red.

Thanks in advance.

SQL Server Integration Services
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

1 answer

Sort by: Most helpful
  1. Naomi Nosonovsky 8,906 Reputation points
    2022-06-20T21:48:09.37+00:00

    UPDATE. Figured this out by using NULL(DT_WSTR) and adding conversion in front to the whole expression.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.