Copy activity - truncate and insert vs upsert

Trystan Mortimer 31 Reputation points
2022-10-20T05:18:08.937+00:00

Assuming I do not need any data which may be removed from my source dataset, what is more efficient?

  1. Truncate a table and reinsert all data
  2. Do not truncate and use upsert

Thanks

252199-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2022-10-20T17:38:24.967+00:00

    Hey,
    With your current ask that in case if the data is no longer in source but used to come earlier and you no longer need it, the only way based on direct copy activity usage wod be to do truncate insert only. Since in case of upsert, data would either be inserted or updated but deletee record in source would always remain active in destination


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.