Low severityexecution
Power BI Refresh Error:
OBJECT_ALREADY_EXISTS (002002)
What does this error mean?
A CREATE statement failed because an object with the same name already exists in the target schema. Snowflake does not overwrite existing objects by default.
Common causes
- 1Running CREATE TABLE, CREATE VIEW, or CREATE PROCEDURE without OR REPLACE or IF NOT EXISTS
- 2An idempotent deployment script runs CREATE statements that were already applied in a previous run
- 3Two concurrent processes attempting to create the same object simultaneously
- 4An object with the same name exists under a different type (e.g., a view and a table sharing a name in the same schema)
How to fix it
- 1Use CREATE OR REPLACE TABLE ... for DDL scripts that should be idempotent
- 2Use CREATE TABLE IF NOT EXISTS ... when you want to skip creation if the object already exists
- 3Check existing objects: SHOW TABLES LIKE 'my_table' IN SCHEMA mydb.myschema
- 4If the intent is to recreate the object, explicitly DROP it first: DROP TABLE IF EXISTS mydb.myschema.my_table
- 5For stored procedures and UDFs, use CREATE OR REPLACE PROCEDURE to update the definition