ADF Copy Activity, Using parameter for query

ADFARI23 21 Reputation points
2022-06-02T17:53:17.297+00:00

Hi All,

I am using "copy activity" to connect to Hive and bring data into SQL MI, for the copy activity I am using "use query" as "query", please see picture 1.
In the query I want to use where clause with a parameter driven value like today date. query will be something like this below

select * from dbo.src_location where businesseffectivedate>=convert(date,GETDATE())
and businesseffectivedate<=convert(date,GETDATE())

I am unable to figure out how to use filter criteria. Can you please help?
I know with the script transformation we can use parameters but in this case its a copy activity.

Picture 1:

207956-copy1.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,861 questions
0 comments No comments
{count} votes

Accepted answer
  1. Subashri Vasudevan 11,206 Reputation points
    2022-06-06T09:04:28.233+00:00

    Hi @ADFARI23 ,

    Thanks for posting your query on Microsoft Q&A platform.

    In copy activity too, you can use query with filter like below.

    -using a plain query using getdate() in the where clause,

    select * from dbo.src_location where businesseffectivedate>=GETDATE()

    • if your where condition column comes from a pipeline parameter called 'dt', use below

    @markus.bohland@hotmail.de ('select * from dbo.src_location where businesseffectivedate>=''',pipeline().parameters.dt,'''')

    Same way you can use the filter condition with variables and functions.

    Please let us know if you are stuck with syntax for your case.

    Thanks.


1 additional answer

Sort by: Most helpful
  1. ADFARI23 21 Reputation points
    2022-06-06T19:20:36.837+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.