Mike R
Mike R

Reputation: 691

ADF - passing parameters within string to SQL Lookup

I'm writing a pipeline, where I fetch SQL queries from a metadata database in a lookup with the hope to execute those later on in the pipeline. Imagine a string stored in a database:

"SELECT * FROM @{pipeline().parameters.SchemaName}.@{pipeline().parameters.TableName}"

My hope was when passing this string to another Lookup activity, it would pick up the necessary parameters. However it's being passed to the activity as-is, without parameter substitution and I'm getting errors as a result. Is there any clean fix for this or am I trying to implement something not supported by ADF natively?

I found a work-around is just wrapping the string in a series of replace() statements, but hoping something simpler exists.

Upvotes: 0

Views: 1313

Answers (1)

Pratik Somaiya
Pratik Somaiya

Reputation: 733

Can you try below query in the Dynamic Content text box:

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

Upvotes: -1

Related Questions