Datafactory SQL query for several Tables

Axell 66 Reputation points

I have some piplenie, the result of its work are two tables in one DB.
I also have my final SQL query (it is working in MySQL Server)

How i can execute this SQL query into Datafactory for my two tables?
I try to use Lookup Activity but it can use only ONE table.
I also know about DataFlow but there is no place to insert the whole SQL query (screen below)

The question is - how i can insert my SQL Query as final block of my pipeline (screen below)?
I just do not want to do this query in SQL server, if datafactory can do it for me by itself.

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,054 questions
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 37,056 Reputation points Microsoft Employee

    Hi @Axell ,

    Thank you for posting query in Microsoft Q&A Platform.

    Lookup activity will help you to execute query in SQL.

    You should consider selecting query option inside Lookup activity. When you selected Query option, table selected inside dataset will not play any role. Query will directly execute on your DB(database which is selected inside linked service of your dataset).


    Please note, if your actually query not returns anything back. Then try to add select '1' as last statement below your query.

    Hope this will help. Please let us know if any further queries.


    Please consider hitting Accept Answer button. Accepted answers helps community as well.

0 additional answers

Sort by: Most helpful