Reputation: 78
Environment:
MS Azure: Blob Container, multiple csv files saved in a folder. This is my source. Azure Sql Database. This is my target
Goal: Use Azure Data Factory and build a pipeline to "copy" all files from the container and store them in their respective tables in the Azure Sql database by automatically creating those tables.
How do I do that? I tried following this but I just end up having tables incorrectly created in the database, where table is created with a single column having same name as the table name.
I believe I followed the instructions from that link pretty must as they are.
Upvotes: 1
Views: 831
Reputation: 6043
My CSV file is as follows, one column contains the table name.
The previous steps will not be repeated,it is the same as the link.
At Step3 inside the Foreach activity, we should add a Lookup activity to query the table name from the source dataset.
We can declare a String type variable tableName
pervious, then set the value via expression @activity('Lookup1').output.firstRow.tableName
.
At sink setting of the Copy activity, we can key in @variables('tableName')
.
Upvotes: 2