question

arkiboys avatar image
0 Votes"
arkiboys asked arkiboys edited

read rows from a table

Hello,
I have a table in sql server on prem called dbo.TableNames
There are three rows:
ID TableName
1 table1
2 table2
3 table3

I would like to loop through the dbo.TableNames table and copy into sink...

At present, I have a copy activity which takes a parameter, pEntityName and then depending on which table name I physically type in there, it copies from source(on prem sql) to sink. This bit is fine.
The question I have is how to read each table inside dbo.TableNames and pass each tableName into the copy activity pEntityName parameter?

Thank you

azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

HimanshuSinha-MSFT avatar image
0 Votes"
HimanshuSinha-MSFT answered arkiboys edited

Hello @arkiboys ,
Thanks for the ask and using the Microsoft Q&A platform .
As I understand your pipeline is already parameterized and so all you need to do is

  1. Create a pipeline .
    2.Add a lookup activity and read the table content with a query , eg

    select* from dbo.TableNames .


  2. Add a foreach activity and inside that add execute pipeline
    and then pass the a dynamic expression as the parameter .

@activity('Get the table name and Scheman Name').output.value

I have a slightly different implementation , sharing the animation HTH .

130025-copymultipletable.gif


Please do let me know how it goes .
Thanks
Himanshu
Please do consider clicking on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.