Conditional Split

Conditional Split

Image Posted on Updated on

Use Conditional Split if you need to separate the data from a source (Flat File, Excel, Table, etc.) into multiple destinations (Flat File, Excel, Table, etc.)

Step 1: Drop a Data Flow Task to the Control Flow

1
Data Flow Task

Step 2: Create 4 Flat File Connections. The first flat file is your source. You can use OLE, ODBC, etc.

This second flat file is for my all .txt data

This third flat file is for my all .cs data

This fourth flat file is for my all .aspx data

2
File File Connection Manager Editor Input File
3
Flat File Connection Manager Editor Output Text File
4
Flat File Connection Manager Editor Output CS File
5
Flat File Connection Manger Editor Output ASPX File

Step 3: Drop a Flat File Source into the Data Flow

6
Flat File Source

Step 4: Double click on the Flat File Source and establish the connection by selecting your source file.

7
Flat File Source Editor Connection Manager

Step 5: Drop a Conditional Split into the Data Flow. Drag the arrow from the Flat File Source to the Conditional Split.

8
Conditional Split

Step 6: Double click on the Conditional Split and create three conditions.

9
Conditional Split Transformation Editor

Step 7: Drop three Flat File Destination onto the Data Flow

10
Three Flat File Connections

Step 8: Drag the arrow from the Conditional Split onto one of the Flat File Destination. An Input Output Selection dialog will popup. Select one of the output.

11
Input Output Selection

Repeat this step for all Flat File Destination.

12
Repeat the connection to all three Flat File Connections

Step 9: Double click on the Flat File Destination and select the connection. Repeat this process to the other two Flat File Destination

13
Flat File Destination Editor

Step 10: Run the SSIS package and now you’ll have all three files with specific file types in them.

In this example, I’m using Flat Files but you can use Excel, ODBC, CSV, etc. The process is the same– just the connection setup is different.

Advertisements