Forum Discussion

alloowishus's avatar
alloowishus
Helper I
4 months ago
Solved

Overwrite not working in Copy Data?

I created a Data Copy activity in a pipeline. I accidentally used the "append" and it was duplicating all the data. I had about 14 duplicates of 12 records. I changed it to "overwrite" and I expected...
  • v-hashadapu's avatar
    4 months ago

    Hi alloowishus , Your expectation is understandable, but in Fabric Copy activity the write modes don’t manage existing data, they only control how the incoming batch is written. So once duplicates were created with Append, switching to Overwrite won’t clean up what’s already there because there’s no step that reconciles or removes prior rows.

     

    If you want the table to always reset back to exactly what’s in the source, you need to make that explicit in the pipeline by clearing the target before the load, for example, a SQL/Notebook step to delete or truncate the table, then run the copy. That gives you a true full refresh every time.

     

    If instead you want to prevent duplicates going forward without wiping the table, you should switch to an Upsert pattern with a defined key. That way incoming rows update existing ones instead of being added again, which is the only way to make the load idempotent.