SSIS – XML with row delimiter to a single column of a SQL table

csvssis-2012ssis-2014

I'm trying to upload data from a CSV file into a SQL server table through SSIS package (Flat File source and OLEDB destination). This CSV has comma as column delimiter and {CR}{LF} as row delimiter. This csv file has one column which holds XML data in it. In this XML, they again used {CR}{LF} to make it as a multi-line XML and this XML is placed within a double quotes (""). Ideally, this whole XML needs to be placed in one column however {CR}{LF} makes it as a new row in my table.

Is there any method to have escape sequence and place the whole XML data into a single column?

I'm using Visual studio 2013 and connected to SQL server 2014 database.

Thanks.

Best Answer

In the flat-file connection manager, in the General pane, there is an option to set a text qualifier. If you set this to double quote (") for your file then SSIS should ignore any row delimiters that are contained between the double quotes.

There is also an AlwaysCheckForRowDelimiters property that could help. See this msdn page for more.