Sql2005-ssis the different row types in the same file

Source: Internet
Author: User
Tags contains split ssis
sql2005

Sql2005-ssis the different row types in the same file

Some times the data source is a text file, and sometimes we see the inclusion of primary/fine, parent/child records in the same text file, which is very difficult to handle in DTS, but this situation has changed in SSIS
In this article, I'll make an example of how you can handle this type of requirement

General data flow constructs like the following, I will explain it carefully:

The following figure shows the text format of the data source we want to process, which contains the main row of "M", which contains "D" for Zikong

We'll set up a flat File connection Manager to point to the file, where I'm not going to split the line and read the whole line in a column for the time being.

Next we will drag a Flat File source Adapter component to the Data Flow panel and specify the source and the connection source that is established above, and specify the output column

Once this is done, we will use the Conditional Split Transform component to flow the records in the file to different outputs, configured as follows

Now that we have completed the different flow of the master-slave line, we will use the Script Transform to disassemble the information in the line to different columns.
The first step in using the Script transform component is to add some output columns that, when the data passes through the component, will be visible to the downstream components

By now, we have only defined the script Transform component will produce these columns, but do not specify the contents of the specified column, below we can design the following scripts to implement the contents of different columns

Finally, we only need to put 2 raw File destination Adapter components to receive output, the following is the result of the package run






Article Source: http://www.sqlis.com/default.aspx?54


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.