简体   繁体   中英

Azure Data Factory V2 Using Params in SQL

New to ADF in general and hitting a speed bump with the following scenario, would really appreciate any guidance on how to achieve this.

In my pipeline I want to use simple SQL to control how much data I process, so using:

SELECT * FROM DPA.USER_REGISTRATIONS 
WHERE REG_DATE BETWEEN DATE '2020-01-01' AND DATE '2020-06-09'

Using the 'preview data' button/tool in ADF UI this returns a sample of exactly what I am looking for. Great, but I need the second DATE value to always be the current date. I'm sure this must be very simple but I can't seem to find the right way to form the params/expressions to get it to work.

I am trying:

SELECT * FROM DPA.USER_REGISTRATIONS 
WHERE REG_DATE BETWEEN DATE '2020-01-01' AND DATE @pipeline.parameters.today;

Where I have a pipeline level parameter defined with name: today and value: utcnow() But that doesn't work.

Can someone please advise on how to create and reference a suitable param? Thanks!

To do this based on dynamic values, you will need to use the Pipeline Expression Language (PEL) (and most likely variables) to build the query string. This answer may prove useful to you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM