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