title: Azure Data factory Dataset From a StoredProcedure
body: <p>My goal is to pass data from one SQl azure database (User DB) to another SQl azure database (Datawarehouse) through a stored procedure.</p>
  
  <p>I have created two linked Services, one for each DB. And two DataSets of which I have doubts.</p>
  
  <p>The stored procedure in question collects data from a table and several joins with other tables and returns a result that should be stored in a table in the Datawarehouse</p>
  
  <p>The SP is like this:</p>
  
  <pre><code>ALTER PROCEDURE [DataWarehouse].[Item_init]
  AS
  BEGIN
      SET NOCOUNT ON
      SELECT Id, a.Name, Code, f.Name, s.Name, g.Name
      FROM Item.Item a
          join Item.Groupg on g.idGroup= a.idGroup
          join Item.Subfam s on s.idSubfam = g.idSubfam 
          join Item.Fam f on f.idFam= s.idFam
  
  END
  </code></pre>
  
  <p>The dataset that collects data from the UserDB (I think it is not correct) is like this:</p>
  
  <pre><code>{
      "name": "ds_SProcItem_init",
      "properties": {
          "published": false,
          "type": "AzureSqlTable",
          "linkedServiceName": "UserTable",
          "typeProperties": {
              "tableName": "Item.Item"
          },
          "availability": {
              "frequency": "Hour",
              "interval": 1
          }
      }
  }
  </code></pre>
  
  <p>The other dataset:</p>
  
  <pre><code>{
      "name": "ds_DWItemOutput",
      "properties": {
          "published": false,
          "type": "AzureSqlTable",
          "linkedServiceName": "DataWareHouse",
          "typeProperties": {
              "tableName": "Item"
          },
          "availability": {
              "frequency": "Hour",
              "interval": 1
          }
      }
  }
  </code></pre>
  
  <p>The pipeline that communicates the datasets is as follows:</p>
  
  <pre><code>{
      "name": "SprocItem_InitPipeline",
      "properties": {
          "activities": [
              {
                  "type": "SqlServerStoredProcedure",
                  "typeProperties": {
                      "storedProcedureName": "DataWarehouse.Item_init"
                  },
                  "inputs": [
                      {
                          "name": "ds_SProcItem_init"
                      }
                  ],
                  "outputs": [
                      {
                          "name": "ds_DWItemOutput"
                      }
                  ],
                  "scheduler": {
                      "frequency": "Hour",
                      "interval": 1
                  },
                  "name": "SprocItem_Init"
              }
          ],
          "start": "2016-08-02T00:00:00Z",
          "end": "2016-08-02T05:00:00Z",
          "isPaused": false,
          "hubName": "pruebasaas_hub",
          "pipelineMode": "Scheduled"
      }
  }
  </code></pre>
  
  <p>Please, someone who knows the subject, could you help me?
  Thanks!</p>