Reputation: 2503
I have source query in Copy data activity of Azure Data Factory. Currently it is static query, but I would like to get entire statement from database and use that in Query in Activity.
I try to pass SQL statement as variable there is issue.
Lookup SQL Query for fetching Select statement:
SELECT [source_query] FROM [SalesLT].[configuration] WHERE [Id] = '1'
Query returns and set variable:
SELECT Count(CustomerId) Source_Rows FROM [SalesLT].[Customer]
Error with Copy data:
Type=System.Data.SqlClient.SqlException,Message=Incorrect syntax near
')'.,Source=.Net SqlClient Data
Upvotes: 0
Views: 653
Reputation: 4544
You can't directly use the pipeline parameter in Query instead need to use @concat
function to concatenate your SQL Query with parameters. Please refer the example below:
I suggest you to please go through this tutorial from @TechBrothersIT to get more clarification on the related issue.
Upvotes: 1