metricsign
Start free
Medium severitydata integrity

Power BI Refresh Error:
1364

What does this error mean?

An INSERT statement omits a NOT NULL column that has no DEFAULT value defined.

Common causes

  • 1A new NOT NULL column was added to the table without a default value, breaking existing INSERT statements
  • 2ADF column mapping does not include the new required column
  • 3dbt model SELECT does not include all NOT NULL columns
  • 4strict_mode is enabled (STRICT_TRANS_TABLES) — MySQL enforces NOT NULL constraints strictly

How to fix it

  1. 1Step 1: Add a DEFAULT value to the column: `ALTER TABLE your_table ALTER COLUMN new_col SET DEFAULT 'default_value';`
  2. 2Step 2: Or update INSERT statements to include the column: `INSERT INTO your_table (col1, col2, new_col) VALUES (1, 'a', 'default');`
  3. 3Step 3: Update the ADF sink column mapping to include the new column.
  4. 4Step 4: In dbt, add the column to the model SELECT with a default expression: `COALESCE(source_col, 'default') AS new_col`.

Frequently asked questions

Why does this error only appear after a schema migration?

Adding a NOT NULL column without a DEFAULT breaks all existing INSERT statements that do not supply the new column. Always add NOT NULL columns with a DEFAULT or make them nullable initially.

How do I safely add a NOT NULL column to a large production table?

Add it as nullable first: `ALTER TABLE t ADD COLUMN col VARCHAR(255);` — backfill data, then add the NOT NULL constraint: `ALTER TABLE t MODIFY COLUMN col VARCHAR(255) NOT NULL;`

Can MetricSign detect when a schema migration breaks existing pipelines?

Yes — MetricSign surfaces ADF pipeline failures with the MySQL error code immediately after the schema change breaks the first pipeline run.

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

Other data integrity errors