Scenario:
Let’s say we get data for three countries (USA, Mexico, and
Brazil) in one flat file. “The Country Name” column holds the names for
countries. We have created three different tables each with country name (dbo.tbl_USA,
dbo.tbl_Mexico, dbo.tbl_Brazil). We want to read data from flat file and
redirect related data to each of the table.
Solution:
SSIS provide transformation called “Conditional Split” that
can route data rows to different outputs depending upon the data in column. In
our case we will use Country Name to generate three outputs. The transformation
also provides default output. If we will get any data different from USA, Mexico,
and Brazil that will be redirect to default output.
Here is the data I used in flat file
CountryName,SalePersonName,SaleAmount
uSA,aamir shahzad,100
Italy,andy,200
UsA,Mike,500
brazil,Sara,1000
INdia,Neha,200
Brazil,Barbra,200
Mexico,Anthony,500
Step 1:
Create flat file connection to your text file in which you have used above data.
Step 2:
Bring Conditional Split transformation to Data Flow pane as shown in figure and connect Flat File Source to Conditional Split transformation. Write expressions as shown below in snapshot. Please note that Conditional Split is case sensitive. We can use single or multiple columns and conditions in expressions depending upon the requirement.
How to use Conditional Split Transformation in SSIS Package to split data into multiple outputs |
Step 3:
Connect Outputs to required destinations. In our example I have used Multicast transformations as Test destinations and data viewers between Conditional Split and Multicast so we can see the data. As we can see the data is redirected to required outputs depending on the Country Name. As we do not have any conditions for India and Italy so those rows are directed to Default Output.
How to use write Expressions in Conditional Split transformation to split incoming data to multiple outputs in SSIS Package |
Video tutorial "How to use Conditional split to load data to multiples tables in SSIS Package"
Related Posts / Videos on Conditional Split Transformation
- How to filter Rows with Null values in Data Flow Task in SSIS Package
- How to filter Rows with Blank values in Data Flow Task in SSIS Package
- How To Redirect or Remove Duplicate Records in Data Flow Task in SSIS Package
- How to filter Null records in Data Flow Task by using Conditional Split Transformation in SSIS Package
- How to write expressions in Conditional Split Transformation in SSIS package
- How to use Conditonal Split to Load Data To Multiple Tables in SSIS Package
Đặt vé tại phòng vé Aivivu, tham khảo
ReplyDeletesăn vé máy bay giá rẻ đi Mỹ
vé máy bay hà nội sài gòn bamboo
vé máy bay đà nẵng hà nội bamboo
lịch bay hà nội đà lạt
vé máy bay sài gòn bình định
xe taxi sân bay nội bài giá rẻ
combo dalat