MetricSign
EN|NLRequest Access
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

  1. 1Use CREATE OR REPLACE TABLE ... for DDL scripts that should be idempotent
  2. 2Use CREATE TABLE IF NOT EXISTS ... when you want to skip creation if the object already exists
  3. 3Check existing objects: SHOW TABLES LIKE 'my_table' IN SCHEMA mydb.myschema
  4. 4If the intent is to recreate the object, explicitly DROP it first: DROP TABLE IF EXISTS mydb.myschema.my_table
  5. 5For stored procedures and UDFs, use CREATE OR REPLACE PROCEDURE to update the definition

Frequently asked questions

Does CREATE OR REPLACE preserve table data?

No — CREATE OR REPLACE TABLE drops the existing table and recreates it, losing all data. Use ALTER TABLE to modify structure, or CTAS (CREATE TABLE AS SELECT) patterns with a rename strategy to preserve data.

Can OBJECT_ALREADY_EXISTS occur for views and tables with the same name?

Yes — views and tables share the same namespace in a Snowflake schema. You cannot have a view and a table with the same name in the same schema.

Other execution errors