title: Populate Azure Data Factory dataset from query
body: <p>Cannot find an answer via google, msdn (and other microsoft) documentation, or SO.</p>
  
  <p>In Azure Data Factory you can get data from a dataset by using copy activity in a pipeline.  The pipeline definition includes a query.  All the queries I have seen in documentation are simple, single table queries with no joins.  In this case, a dataset is defined as a table in the database with "TableName"= "mytable".  Additionally, one could retrieve data from a stored procedure, presumably allowing more complex sql.</p>
  
  <p>Is there a way to define a more complex query in a pipeline that includes joins and/or transformation logic that alters the data from  or pipeline from a query rather than stored procedure.  I know that you can specify fields in a dataset, but don't know how to get around the "tablename" property.</p>
  
  <p>If there is a way, what would that method be?</p>
  
  <p>input is on-premises sql server.  output is azure sql database.</p>
  
  <p><strong>UPDATED for clarity.</strong></p>