Share via

Add external data to Azure sql table - add or replace the original data?

Zhang, Gongliang 1 Reputation point
2022-01-06T18:11:05.987+00:00

Hi team,
I will load external data into an existing Azure sql data table via ADF (copy data). My question is: the new dataset loaded will replace the old dataset or the new dataset will be appended to previous dataset?
If new dataset were appended to old dataset, how about the duplicated rows between new and old dataset? keep duplicates or drop duplicates? Thanks
Best,
GZ

Azure SQL Database
Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Martin Cairney 2,276 Reputation points
    2022-01-06T22:56:08.183+00:00

    By default it will append to the existing data unless you also include a task to delete all the records or truncate the table.

    You will need to manage the handling of updated rows separately - I would suggest that you load into a temporary table and then use the T-SQL
    MERGE
    command to move and update the rows into the final table.

    Was this answer helpful?

    0 comments No comments

Your answer

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