SSIS--
BdrakeEX CMUNX9BXRJ CCN41RGJLK (v2.000) (CVCV0FL21/27005 201),
start Thu 4/14 11:13 (linger: 2514180) -
akmadas - AASDASMECH_AA_C:
-->Col! -- BdrakeEX CMUNX9BXRJ CCN41RGJLK (v2.000) (CVCV0FL21/27005 201)
required fields bolded
Col2 -- start Thu 4/14 11:13 (linger: 2514180) -
akmadas - AASDASMECH_AA_C:
required fields bolded
I have the above record in a flat file and i need to parse this into a table.
COL1, COL2 --as shown above.
I jhave to further split column using space delimited --as shown above, I only want few fields from COL1. and
The same with the COL2. here it is dash delimited and colon Delimited
can any one suggest me how to get this done in SSIS, first coma delimited ---> i get two columns...
.i have to further go down on each column( internally has different delimiters) and get only desired fields...(BOLDED REQUIRED DATA IN FIRST FIeld)
May 13th, 2011 5:29pm
It is hard to see what you posted. I recommend to just load the whole record into a staging table and then parse with T-SQL.
Another approach is to use a Script Component and then it will be a .Net code.
What are you more comfortable with?Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 5:32pm
You're going to need a Script Component on the Data Flow to act as the Source Adapter. It will read the text file row by row and then go through the logic you write in the code to determine what goes into what fields. Best to start by loading the entire
row into a string variable, then have a sub routine that parses out that string into its various parts. Lastly, call the sub to generate an output row and assign values to your output columns from their corresponding 'various parts'Todd C - MSCTS SQL Server 2005 - Please mark posts as answered where appropriate.
May 13th, 2011 5:33pm
I didn't understood your sample row exactly. let us know what is your expected result for this sample input row?
and for solution, I recommend these methods:
1-you can use comma delimited , and then use a Derived Column transformation to split it to new columns based on another delimiter with expressions.
2-also you can use Script Component As Source and write your own .net script to fetch data with any delimiter you need.
first method is better if you haven't good experience in .NET scripts and your delimiters are not very vary. second method is better if you are a .NET developer and your delimiters are complex .
for more details let us know what is your expected results for that sample input row?http://www.rad.pasfu.com
Free Windows Admin Tool Kit Click here and download it now
May 13th, 2011 5:35pm
Some detailed info related to Todd C's post:
Handling Flat Files with Varying Numbers of Columns
Talk to me now on
May 13th, 2011 8:24pm