SSIS Package for data migration issue_urgent help..
-
Tuesday, November 20, 2012 6:26 PM
Hi...
I am migrating data from flat file source to database using ssis
The flat file is like:
Column 0 Column1 Column2 Column3 B:Ferrari C:Fiat D:BMW E:Hyundai Quantity 12345 2345 1234 Amount 567 456 444 Loss 234 876 444 Profit 12345 66666 9897 From the flat file above the data is needed to load in database in the below manner:
- Parse the row that starts with “B/C/D:”, column 0
- New Column “Name”.......................in database
- Take the value after the “:”.............for database
- Parse the row that starts with “Quantity”, column 0
- New Column “Qty”
- Take the value in Column 2
- Parse the row that starts with “Amount”, column 0
- New Column “Amt”
- Take the value in Column 3
and so on..
How to do the above using SSIS. Can it be done through pivot operation??
Please anyone suggest solution.Its very urgent....
j
- Parse the row that starts with “B/C/D:”, column 0
All Replies
-
Tuesday, November 20, 2012 9:05 PM
-
Tuesday, November 20, 2012 9:09 PMModerator
Break this file apart into two files.
Then load each one into a separate staging table and finally create a proper SQL join or make multiple Execute SQLs in the SSIS package to further transform the data.
You would need to use a Conditional Split transform to split the file apart based on a condition, perhaps the record length.
I am just not sure about the keys for the unpivot transformation.
Arthur My Blog

-
Wednesday, November 21, 2012 12:31 AM
Not Very clear what the output will be, I would suggest to show in a tabular form the desired result.
I would use a conditional split to separate the columns that start with A/B/C on one branch and the rest in another branch. Then use script component destination.
-
Wednesday, November 21, 2012 4:00 AMI am new to ssis . Can you tell me how to do and what .NET script task code to be written..
j
-
Wednesday, November 21, 2012 4:02 AM
Hi Arthur,
Since i am new to ssis can you be more clear for your solution..
Can you please tell me stepwise..
j
- Edited by j_aer Wednesday, November 21, 2012 4:03 AM
-
Wednesday, November 21, 2012 4:09 AM
Hi Fanor,
The table will be like:
Name Qty Amt Ferrari Column 2 value from flat file source Column 3 value from flat file source Fiat Column 2 value from flat file source Column 3 value from flat file source
and so on.....
Please elaborate how to do with conditional split.If not then what custom code can I use for this??
j
-
Wednesday, November 21, 2012 6:49 PMModerator
Hi Arthur,
Since i am new to ssis can you be more clear for your solution..
Can you please tell me stepwise..
j
here http://consultingblogs.emc.com/jamiethomson/archive/2005/12/04/SSIS-Nugget_3A00_-Splitting-a-file-into-multiple-files.aspx is a very good post that demonstrates how a file can be split into chunks conditionally.Arthur My Blog

- Proposed As Answer by ArthurZMVP, Moderator Wednesday, November 21, 2012 6:49 PM
- Marked As Answer by Eileen ZhaoMicrosoft Contingent Staff, Moderator Tuesday, November 27, 2012 1:45 AM

