Sql-server – the locale id ‘0’ of the source column ‘PAT_NUM_ADT’ and the locale id ‘1033’ of the destination column ‘PAT_ID_OLD’ do not match

localesql server

I get this error when I do a bulk insert with select * from [table_name], and another table name:

the locale id '0' of the source column 'PAT_NUM_ADT' and the locale id '1033' 
of the destination column 'PAT_ID_OLD' do not match

I tried resetting my db collation but this did not help.

Has anyone seen this error?

Best Answer

If you are copying less than a full set of fields from one table to another, whether that table is on another domain across the world, or is collocated in the same database, you just have to select them in order. SqlBulkCopyColumnMappings do not work. Yes, I tried. I used all four possible constructors, and I used them both as SqlBulkCopyMapping objects and just by providing the same information to the Add method of SqlBulkCopy.ColumnMappings.Add.

My columns are named the same. If you're using a different name as well as a different order, you may well find that you have to actually rename the columns. Good luck.