1

I'm trying to automatically update tables in Azure SQL Database from another SQLDB with Azure Data Factory. At the moment, the only way to update the table Azure SQL Database is to physically select the table you want to update in Azure SQL Database, as shown here:

enter image description here

My configuration to automatically select a table the SQLDB that I want to copy to Azure SQL Database is as follows:

enter image description here

The parameters are as follows:

@concat('SELECT * FROM ',pipeline().parameters.Domain,'.',pipeline().parameters.TableName)

Can someone let me know how to configure my SINK and/or connection to automatically insert the table selected from SOURCE.

My SINK looks like the following: enter image description here

And my connection looks like the following: enter image description here

1 Answer 1

2

Can someone let me know how to configure my SINK and/or connection to automatically insert the table selected from SOURCE.

You can use Edit option in the SQL dataset.

Create a dataset parameter for the sink table name. In the SQL sink dataset check the Edit checkbox in it and use the dataset parameter. If you want, you can use dataset parameter for the database name also. Here I have given directly (dbo).

enter image description here

Now in the copy activity sink, you can give the table name dynamically from any pipeline parameter (give your parameter in this case) or any variable using the dynamic content.

enter image description here

Also, enable the Auto create table which will create new table if the table with the given name not exists and if it exists it ignores creation and copies data to it.

My sample result:

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Hi Rakesh, thanks again for reaching out . I'm going to test your solution in 10 minutes.
Hi @Patterson, did you try it?
Hi @Rakesh, I did try it and it work perfectly thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.