Azure Data Factory Copy Tables: How to set an Order in copy activity

44406131 0 Reputation points
2023-07-21T09:12:20.07+00:00

Dear all,

i am currently designing an adf to copy tables from one database to a an azure sql database. The destination azure sql database has foreign keys defined on these tables.

I would like to indicate an order to the copy activity in this way:

-copy parent tables first

-copy child tables at second.

I do not want to use the stored procedure to achieve this. the sequential option did not help.

Do you have any ideas how to achieve this?

Thanks

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. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2023-07-24T06:46:58.67+00:00

    Hi 44406131,

    Thank you for posting query in Microsoft Q&A Platform.

    If I understand correctly, you are trying to copy multiple tables, and to do this, you may be having a loop (foreach activity) to loop through every table name and inside loop you may be using Copy activity. Please correct me if my understanding is wrong and share more details on implementation.

    If above is true, then to copy parent table first and then copy child table, make sure in the loop parent table comes first and in the ForEach activity, set Sequence execution to true.

    User's image

    For any reason, you cannot control order of table names in the loop then try to take only parent table names from source first and process them. After that take child names and process them.

    Hope this helps. Please let me know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers help community as well.


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.