Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

How to make a CASE STATEMENT (Case when ....then...) in SSIS Expand / Collapse
Author
Message
Posted Monday, February 11, 2013 10:43 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, July 28, 2014 10:09 AM
Points: 98, Visits: 296
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!
Post #1418557
Posted Tuesday, February 12, 2013 6:57 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, July 28, 2014 10:09 AM
Points: 98, Visits: 296
Do I need to provide more information? haven't received a reply. Thanks.
Post #1418936
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse