Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Import row based complex csv or excel to DB using SSIS

$
0
0

What is the best approach to deal with complex row based object hierarchy in CSV or Excel file in importing into DB?

eg. We have the following CSV or Excel data (Pipe delimited and \r\n separate a new row):

START|\r\n

MEMBER|Mr|John|Lee|\r\n

INSURANCE|2015-1-15|LIFE|\r\n

END|\r\n

START|\r\n

MEMBER|Ms|Mary|Scott|\r\n

INSURANCE|2015-1-10|LIFE|\r\n

END|\r\n

....

....

Here each START/END marks one record. The final goal is to transform it into an XML like this:

<Members>

   <Member>

     <Title>Mr<\Title>

     <FN>John<\FN>

     <LN>Lee<\LN>

     <Insurance>

         <Join_Date>2015-1-10<\Join_Date>

         <Category>Life<\Category>

     <\Insurance>

   <\Member>

...  

   <Member>

...

   <\Member>

<\Members>

 Thanks for any input.


Viewing all articles
Browse latest Browse all 24688


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>