SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to make a CASE STATEMENT (Case when ....then...) in SSIS


How to make a CASE STATEMENT (Case when ....then...) in SSIS

Author
Message
rs80
rs80
SSC-Enthusiastic
SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)

Group: General Forum Members
Points: 199 Visits: 379
I had to convert this to ssis:


WHEN CAST(T1.[ORIG_DT] as datetime) >= T.[SETTLE_dt] THEN '1'
WHEN CAST(T1.[ISSUE_DT] as datetime)>= T.[settle_dt] THEN '3'
WHEN CAST(T1.[ISSUE_DT] as datetime) >= T.[Output_dt] AND T1.[ISS_STK] = '1' THEN '4'
ELSE NULL
END AS [offering_type_cd]



I did the following:
1) conditional split
2) 4 derived columns
3) union all

The part that was confusing was that in the "union all" all of the other columns in the dataset showed up. I thought only the derived column (OfferingTypeCode) would appear in the union all.

Also, I wasn't sure how to get NULL as one of the conditions. Currently, in the conditional split the last order I have is condition 1==0 and created Output OfferingTypeCode5. The expression in the derived column OfferingTypeCode5 is NULL(DT_I4). Is this correct?

Thanks!
rs80
rs80
SSC-Enthusiastic
SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)SSC-Enthusiastic (199 reputation)

Group: General Forum Members
Points: 199 Visits: 379
Do I need to provide more information? haven't received a reply. Thanks.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search