Moving data from Snowflake to Azure SQL DB using Copy Activity

PK 20 Reputation points
2024-09-04T14:26:06.79+00:00

Hi All,

I am using COPY activity to move data from Snowflake to Azure SQL DB. First of all, this data movement is not allowed without intermediate staging of the data in ADLS. I would love to avoid this intermediate step. If this is how it will work then it's fine but it is causing an issue with "Sink" step. I have an option of Auto creating table in Azure SQL in the Sink . The problem that I am facing is that when there is no data in Snowflake to export and move to Azure SQL DB , then there are no files created in intermediate Staging storage account and in that situation the next step of Auto Creating the table in Sink is not happening. This is leading to failure in ADF pipeline in next steps as there are steps which expects the table to be present but since the table is not getting created in cases when there is no data it is causing a problem. How can we handle this situation ? Please help.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,566 questions
{count} votes

Accepted answer
  1. Smaran Thoomu 14,870 Reputation points Microsoft Vendor
    2024-09-10T21:10:03.3866667+00:00

    Hi @PK

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others "I'll repost your solution in case you'd like to accept the answer.

    Issue: I am using COPY activity to move data from Snowflake to Azure SQL DB. First of all, this data movement is not allowed without intermediate staging of the data in ADLS. I would love to avoid this intermediate step. If this is how it will work then it's fine but it is causing an issue with "Sink" step. I have an option of Auto creating table in Azure SQL in the Sink . The problem that I am facing is that when there is no data in Snowflake to export and move to Azure SQL DB , then there are no files created in intermediate Staging storage account and in that situation the next step of Auto Creating the table in Sink is not happening. This is leading to failure in ADF pipeline in next steps as there are steps which expects the table to be present but since the table is not getting created in cases when there is no data it is causing a problem. How can we handle this situation ? Please help.

    Solution: To tackle this situation, we have an explicit Delete Activity before Copy which tales care of deleting the subfolders before the next iteration of COPY activity runs.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most 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.