Thanks for using Microsoft Q&A forum and posting your query.
It looks like you’re encountering a common issue when transferring data from MySQL to Azure SQL Database using Azure Data Factory. The error message indicates that the UInt64
type from MySQL is not supported in Azure SQL, which typically uses INT
or BIGINT
for integer types.
Here are a few approaches you can consider to resolve this issue:
- Modify the Data Type in the Source Query: Since you mentioned that casting the
id
column works, you could create a view in your MySQL database that casts theid
column to a compatible type (likeBIGINT
). Then, you can use this view in yourSELECT *
statement. For example: SQL
Use a Mapping in Azure Data Factory: If you want to keep usingCREATE VIEW my_view AS SELECT CAST(id AS SIGNED) AS id, col2, ... FROM [mysql_schema].[table];
SELECT *
, you can define a mapping in the Copy Activity settings. In the mapping section, explicitly map theid
column to a compatible type in Azure SQL (likeBIGINT
). - Edit the JSON Payload: If you’re comfortable with JSON, you can directly edit the JSON payload of the Copy Activity to specify the data type for the
id
column. This can be done in the Azure Data Factory UI by switching to the code view.
Check Driver Versions: Ensure that you are using the recommended MySQL driver version in Azure Data Factory, as this can affect data type compatibility.
If you need to maintain the flexibility of using SELECT *
, the view approach is often the most straightforward
Hope this helps. Do let us know if you any further queries.