How to DROP constraints and CREATE them in a pipeline

Bigiron 110 Reputation points
2023-07-18T12:08:44.5266667+00:00

Hi All,

In my pipeline I have TRUNCATE INSERT logic, but some tables cannot be truncated because they are referenced by a FK. Is there a way before the COPY Activity that I can DROP constraints and after the COPY is done Create them? What activity should I use. Please advice.

Thanks

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

Accepted answer
  1. Suba Balaji 10,936 Reputation points
    2023-07-18T13:21:47.34+00:00

    Hi @Bigiron

    Thanks for your query and using MS Q&A Platform.

    For DDL\DML commands, you can make use of script activity in Azure Data Factory\ Synapse Analytics.

    Please refer the below links for more details.

    https://techcommunity.microsoft.com/t5/azure-data-factory-blog/execute-sql-statements-using-the-new-script-activity-in-azure/ba-p/3239969

    https://www.mssqltips.com/sqlservertip/7427/azure-data-factory-script-activity-deploy-databases/

    Video Reference:

    https://www.youtube.com/watch?v=CLeVkS3XpMU

    Please let us know if that helps.

    Thanks.


0 additional answers

Sort by: Most helpful