简体   繁体   中英

Is there a way to author a SQL query from inside Azure Data Factory?

试图找到一种从 ADF 内部编写 SQL 查询的方法,这是可能的,还是需要创建一个视图来做类似的事情?

是的,我们可以根据您要实现的目标,复制活动,查找活动是几个例子

Most of time, yes you can author SQL queries from inside of ADF.

For SQL server and Azure SQL database, copy data from or to SQL server or Azure SQL database support you use the SQL query to select the data.

For example, using 'Copy Data' to copy data between Azure SQL: 在此处输入图片说明

But these SQL queries are used for Source dataset settings .

There are a lot examples can help you understand Azure Data Factory Copy Actives.

Such as: Copy Data From On-Premise SQL Server To Azure Database Using Azure Data Factory .

I suggest you read more about Azure Data Factory Document . You will have the answer more clearly.

Hope this helps.

It depends on what you mean with "author SQL queries".

If you want to write sql queries based on input from other activities and execute them you can do this by using dynamic content (click on "add dynamic content" on the query field where you want to execute the sql query, eg in copy data or lookup)

If you want to run sql code on a data source from a data factory eg to create a table there you can use the lookup activity and just add a ;select 1; in the end. eg

Select * into newtable from oldtable; select 1;

Also you could use a stored procedure on a data source eg azure sql or sql server and provide properties from data factory.

For all this best to create a dataset where you leave the "table" property empty and use this.

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