Holmes IV
Holmes IV

Reputation: 1739

SSIS Convert Unicode 65001 to ANSI 1252

I am working with SSIS to import a CSV. The the package has been working for several years now to import 10K rows into a SQL Server Table. The provider of the source file has switch to a Unicode 65001 system. I have had no luck converting this into something my SQL Server 2008 database can use. Things I have tried include : Add a conversion step converting to [DT_STR] 1252 ANSI, Changing all the columns in the database to NVARCHAR from VARCHAR, create whole new table of NVARCHAR, Copy the Flat file and change line endings, Transfer the File to a Stage table. In all case I get the same error "Cannot convert between 65001 and 1252. I have done similar things from Oracle databases and the conversion step has worked. Note, there are no unicode characters in the file, it is generated out of an Oracle system.

Upvotes: 2

Views: 6490

Answers (1)

Holmes IV
Holmes IV

Reputation: 1739

I found my solution here : http://slavasql.blogspot.com/2015/08/ssis-conversion-from-unicode-to-non.html

Basically you add a visual basic script component, set the Unicode columns to New output columns that are 1252. That is it.

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
    Row.NonUnicodeAMTS = Row.AMTS

End Sub

Upvotes: 3

Related Questions