Incremental Load in Azure Data Factory

39861377 141 Reputation points
2022-03-02T08:06:53.483+00:00

Hi,

Requirement: Fetch data from on-premise using ADF and load it into Synapse incrementally.

Problem: We don't have a unique value column to perform upsert taking that column as the key. There is a 'change_date' column indicating the last modified date, we can extract the data from the source based on that date but unable to figure out how to update the already inserted value in synapse which has been modified recently in the source.

Thank you.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vaibhav Chaudhari 38,916 Reputation points Volunteer Moderator
    2022-03-02T11:32:19.877+00:00

    Try implementing incremental data load using Change tracking method as explained here:

    Similar thread

    ----------

    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    1 person found this answer helpful.

  2. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2022-03-10T17:09:04.73+00:00

    Hi @39861377 ,

    Thankyou for using Microsoft Q&A platform and posting your query.

    As per your query, it looks like you want to perform incremental load in destination table . The source dataset is having a watermark column called 'change_date' which stores the last modified date value.

    For this requirement, I would suggest you to :

    1. Use look up activity to fetch the max(change_date) value from target table .
    2. Use Copy activity with dynamic query as 'Select * from <SourceTable> where change_date>lookup.output value' and copy the incremental data in stage table.
    3. Write a stored procedure to :
      a. Delete from target table where change_date>=Change_date from stage table
      b. Insert all records from stage table to target table

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    1 person found this answer helpful.

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.