I have twenty four (24) incoming CSV files in the following generalized format:
I want to import into a table using SSIS.
My issues with this file are:
I have multipart question:
asked Sep 07, 2011 at 03:08 PM in Default
In general you can go by two ways how to process this kind of file.
Related to the how to create an XML, you can easily handle this gain in Script Component as destination. You can easily build the XML in the ProcessInputRow method of the Script Component using eg. LINQ to XML (XDocument, XElement). The implementation is very easy and you do not need any third party component for this.
answered Sep 08, 2011 at 12:27 AM
Do you want the files changed to XML before input or you just want them converted to XML? If it's the latter, then just proceed with the import via SSIS and then look into using the FOR XML clause in selecting items from the table to which you import.
As for ignoring the last row, in the table into which you insert, add an identity column and select every row except the last one (the maximum value of the identity column).
I hope that this helps.
answered Sep 08, 2011 at 04:54 AM