In an SSIS package that I'm writing, I have a CSV file as a source. On the Connection Manager General page, it has 65001
as the Code page (I was testing something). Unicode is not checked.
The columns map to a SQL Server destination table with varchar
(among others) columns.
There's an error at the destination: The column "columnname" cannot be processed because more than one code page (65001 and 1252) are specified for it.
My SQL columns have to be varchar
, not nvarchar
due to other applications that use it.
On the Connection Manager General page I then change the Code page to 1252 (ANSI - Latin I)
and OK out, but when I open it again it's back to 65001
. It doesn't make a difference if (just for test) I check Unicode or not.
As a note, all this started happening after the CSV file and the SQL table had columns added and removed (users, you know.) Before that, I had no issues whatsoever. Yes, I refreshed the OLE DB destination in the Advanced Editor.
This is SQL Server 2012 and whichever version of BIDS and SSIS come with it.
If it's a csv file, you can still use code page 1252 to process it. When you open the flat file connection manager it shows you the code page for the file, but you don't need to save that setting. If you have other changes to make in the connection manager, change the code page back to 1252 before you save the changes.
This is actually really easy in SSIS. Select the connection manager in the connection managers pane and hit F4 to open the properties pane. Find Expressions, and open that up. Then you can change the values of the properties you need in there, and use the parameters/variables to define the values.
Ignore Failure: The error or the truncation is ignored and the data row is directed to the output of the transformation or source. Redirect Row: The error or the truncation data row is directed to the error output of the source, transformation, or destination.
In the Solution Explorer pane, right-click on Connection Managers and select New Connection Manager. In the Add SSIS Connection Manager dialog, select FLATFILE, then Add. In the Flat File Connection Manager Editor dialog box, for Connection manager name, enter Sample Flat File Source Data. Select Browse.
If it is a CSV file column text stream [DT_TEXT] to SQL varchar(max) data type that you want to convert to, change the flat file Connection Manager Editor property Code page to 1252 (ANSI - Latin I).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With