metricsign
Start free
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

  1. 1Step 1: In ADF, add a Derived Column transformation to cast or coalesce: `iifNull(toInteger(source_col), 0)` before the MySQL sink.
  2. 2Step 2: In dbt, cast the column explicitly: `CAST(NULLIF(TRIM(source_col), '') AS SIGNED) AS int_col`.
  3. 3Step 3: In MySQL, use CAST on insert: `INSERT INTO t (int_col) VALUES (CAST('123' AS SIGNED));`
  4. 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

Why did MySQL accept empty strings in integers before but now rejects them?

MySQL 5.7+ enables STRICT_TRANS_TABLES by default. Older MySQL 5.6 and earlier allowed empty strings to silently convert to 0. After a MySQL upgrade, existing pipelines may start failing.

How do I check if MySQL strict mode is enabled?

Run `SELECT @@sql_mode;` — if the output includes STRICT_TRANS_TABLES, strict mode is active.

Can MetricSign alert me when this error appears in a pipeline?

Yes — MetricSign captures ADF pipeline failures and surfaces the MySQL error code, so you know immediately which pipeline is affected by strict mode violations.

Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

Other data integrity errors