Medium severitydata integrity
Power BI Refresh Error:
1366
What does this error mean?
A non-numeric string or out-of-range value is being inserted into an integer column with strict mode enabled.
Common causes
- 1Source data contains empty strings ('') instead of NULL for integer columns
- 2Non-numeric text value mapped to an INT or BIGINT column
- 3ADF column mapping passes a string type to a numeric column without conversion
- 4strict_mode (STRICT_TRANS_TABLES) is enabled — MySQL 5.7+ defaults to strict mode
How to fix it
- 1Step 1: In ADF, add a Derived Column transformation to cast or coalesce: `iifNull(toInteger(source_col), 0)` before the MySQL sink.
- 2Step 2: In dbt, cast the column explicitly: `CAST(NULLIF(TRIM(source_col), '') AS SIGNED) AS int_col`.
- 3Step 3: In MySQL, use CAST on insert: `INSERT INTO t (int_col) VALUES (CAST('123' AS SIGNED));`
- 4Step 4: If strict mode is not required, disable it: remove STRICT_TRANS_TABLES from the sql_mode variable (not recommended for production).
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html