Medium severityschema
Power BI Refresh Error:
1050
What does this error mean?
A CREATE TABLE statement failed because a table with that name already exists in the database.
Common causes
- 1A migration or dbt model runs CREATE TABLE without IF NOT EXISTS and the table already exists
- 2A failed migration left the table partially created, blocking a re-run
- 3Duplicate migration scripts running twice in CI/CD
How to fix it
- 1Step 1: Use CREATE TABLE IF NOT EXISTS to make the statement idempotent: `CREATE TABLE IF NOT EXISTS your_table (id INT PRIMARY KEY);`
- 2Step 2: If the existing table is from a failed migration, inspect it: `DESCRIBE your_table;` then drop if safe: `DROP TABLE your_table;`
- 3Step 3: In dbt, use `{{ config(materialized='table') }}` which handles drops automatically, or switch to incremental materialization.
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html