Knight's Microsoft SQL Server 2012 Integration Services 24-Hour Trainer
by Brian Knight, Devin Knight, Mike Davis, Wayne Snyder
Chapter 28
Separating Data with the Conditional Split Transform
Sometimes you deal with source data that may require different treatments applied to it. For example, you want to generate a mailing list for a direct mail campaign, but you want to target only customers with children. You want to make sure to separate the customers without kids before preparing the list. You would also like anyone who has more than five kids to receive a buy-two-get-one-free coupon with the mailer.
The best way to separate data within a package to apply different types of actions is with the Conditional Split Transform. With this transform, you can send data from a single data path to multiple outputs based on conditions set in the Conditional Split Transformation Editor, shown in Figure 28-1. To open the editor, drag the transform in the design surface and double-click it.
The Conditional Split Transform uses the SSIS expression language to determine how the data pipeline should be split. For this example, all you need to know is that the Conditional Split Transform is checking to see if customers have more than five kids so they can receive the extra coupon.
This check produces three possible outputs:
- For customers with more than five children ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access