简体   繁体   中英

pass parameters to SQL query in Azure data factory

How can we pass parameter to SQL query in Azure data factory ...

ex: Select * from xyz_tbl where date between @date1 and @date2

if I use stored procedure with output @date1 and @date2 parameter, how can I pass these parameter to sql query.

Which version of Azure DataFactory are you using, v1 ir v2?

If v2 is an option for you, you could achieve this by using Lookup activity that queries the database to get your dynamic properties and then referencing that activity's output in your sql query like so:

select * from from xyz_tbl 
where date between @{activity('LookupActivity').output.date1} 
and @{activity('LookupActivity').output.date2}

Here's a more detailed msdn tutorial for the Lookup activity: https://docs.microsoft.com/en-us/azure/data-factory/control-flow-lookup-activity

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