.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> DataBase >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Conditional Split Task in SSIS - SQL Server Integration Services (SSIS) - Part 15

Posted By:Karthikeyan Anbarasan       Posted Date: March 21, 2011    Points: 200    Category: DataBase    URL: http://www.dotnetspark.com  

In this article we are going to see on how to use a Conditional Split task based on the decision in SQL Server Integration Services (SSIS). Conditional tasks transformation will be used to split the data based on some condition and save the result set in different destinations
 

Introduction

In this article we are going to see on how to use a Conditional Split task based on the decision. Conditional tasks transformation will be used to split the data based on some condition and save the result set in different destinations. This task will be very useful at cases like to insert some passed test cases data to Database and the failed test cases data to the text file or sending a mail to the administrator.

To follow my series of articles on SSIS packages refer to the below URL's

Basics of SSIS and Creating Package - SQL Server Integration Services (SSIS) - Part 1

Transforming SQL Data to Excel Sheet - SQL Server Integration Services (SSIS) - Part 2

Export Data using Wizard - SQL Server Integration Services (SSIS) - Part 3

Import Data using Wizard - SQL Server Integration Services (SSIS) - Part 4

Building and Executing a Package - SQL Server Integration Services (SSIS) - Part 5

Options to execute a package in SSIS - SQL Server Integration Services (SSIS) - Part 6 

Options to Deploy a package in SSIS - SQL Server Integration Services (SSIS) - Part 7

Scripting in SSIS Packages - SQL Server Integration Services (SSIS) - Part 8

Breakpoints in SSIS Packages - SQL Server Integration Services (SSIS) - Part 9

Check Points in SSIS Packages - SQL Server Integration Services (SSIS) - Part 10

Send Mail in SSIS Packages - SQL Server Integration Services (SSIS) - Part 11

For Loop task in SSIS Packages - SQL Server Integration Services (SSIS) - Part 12

Backup Database task in SSIS and Send Mail - SQL Server Integration Services (SSIS) - Part 13

Folder Structure in SSIS - SQL Server Integration Services (SSIS) - Part 14

Steps:

Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use Conditional Split transformation task options available with SSIS.

Once the project is opened, now we can proceed to the steps on how to create a conditional split and see how to configure the task.

Drag and drop a Data Flow Task and double click on the same will open the Data Flow tab as shown in the below figure add a Flat File source which is going to be an input for the package. I have configure the Flat File source (Refer to previous articles on how to configure the Flat File Source).


Input file for the Flat File source will be like below


Here we are going to save the application name into different destination files based on the Country (US or India). To achieve this task I just dragged and dropped the Conditional Split task as shown in the above image. Now in order to configure the task just double click on the Conditional Split task


To make this configuration as shown in the above image just drag and drop the Column which u are going to make it as a condition here in this example I dragged and dropped Column 4 to the bottom pane and give the condition(both) as shown in the above screen.

Once above configuration is done click on the OK button. Now we need to make the destination configure. Here I'm saving the destination data to a different Flat File as FILEUS and FILEINDIA. So drag and drop 2 flat file destinations and configure as shown in the below screen


Once configured now click on the F5 button to build and execute the package. You will see the below screen once the execution is completed.


You can see 2 new files created for US and INDIA countries as shown in the below screen.




Conclusion

In this article we have seen on using the Conditional Split task on how to configure and use the same in order to achieve multiple destination output based on the condition.


 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend