Home > Net >  Can I get table name from source path in ADF?
Can I get table name from source path in ADF?

Time:09-17

I have a ADF pipeline with an ODATA source.

I'm copying that into an SQL database using autocreate table. I would like to autogenerate the table name as well, but I can't figure out how it's done.

The name I would like to use is the Path name from the source: enter image description here

It should somehow be used as the table name:

enter image description here

Is this possible in ADF?

CodePudding user response:

Can I get table name from source path in ADF?

we cant access dataset name in pipeline to work around this we can get dataset name by creating parameter

To get Source table name in sink first we have to create parameter or variable in pipeline with name tablename and type string.

enter image description here

Then create parameter in source dataset as table name with type string.

enter image description here

Then in the path add dynamic value @dataset().tablename to get value of parameter created in above step.

enter image description here

In dataset properties add dynamic value for table name @pipeline().parameters.tablename to get value from pipeline parameter and pass this value to source dataset.

enter image description here

Then create parameter in sink dataset as table name with type string.

enter image description here

Then in the schema name add dbo and in tablename add dynamic value @dataset().tablename to get value of parameter created in above step.

enter image description here

In dataset properties add dynamic value for table name @pipeline().parameters.tablename to get value from pipeline parameter and pass this value to sink dataset.

enter image description here

Successfully copied table with same name from ODATA source to SQL database.

enter image description here

Note: I have table name Airlines in my ODATA source.

  • Related