Pre-script on copy data activity for truncating the tables having a foreign key references

Priyanka Vemula 1 Reputation point
2022-12-06T10:04:34.183+00:00

I need to copy multiple tables from one server to another server where I need to truncate the tables daily and load it again.
But all my tables are having foreign key references where I cannot use truncate .

Could anyone please help me here

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-12-06T10:24:15.377+00:00

    Hey,
    you can start the truncate queries from the child table and then start populating from parent table.

    meaning use a script activity with sequential execution of truncate tables from child to parent
    and then use copy activity to sequentially load the tables from Parent to child

    0 comments No comments

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.