How to fix ODBC Driver Error "Invalid Character Conversion"

Hartman, Richard 0 Reputation points
2025-06-06T18:30:25.0066667+00:00

We are transferring data from sybase to mssql server, and the migration assistant is throwing "invalid character conversion" errors for some fields. These fields contain things like a degree symbol (alt-0176).

I tried getting at the data directly using a python script and pyodbc, and it threw the same error:
U:\scratch>python pyquery.py

Error: ('HY000', '[HY000] [SAP][ASE ODBC Driver]Invalid character conversion. (30062) (SQLGetData); [HY000] [SAP][ASE ODBC Driver]Invalid character conversion. (30062)')

So I can't script a data substitution that way.

The column type in both the source (sybase) and destination (mssql server) is VARCHAR.

There are other non-standard characters, like the em-dash. They are not all just degree signs, so I can't just make a substitution assuming all invalid characters are one thing.

Is there any way to disable this error? Or establish a substitution table for the migration assistant?

SQL Server Migration Assistant
SQL Server Migration Assistant
A Microsoft tool designed to automate database migration to SQL Server from Access, DB2, MySQL, Oracle, and SAP ASE.
568 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.