'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.



Solution 1:[1]

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

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pratik Somaiya