locked
Use pipeline parameters within my SQL source Request (bad description causes a RUN failure) RRS feed

  • Question

  • Hi

    I am a beginner on DataFactory and more used to working with SSIS

    I would like to know, please  how to properly use in my source SQL query the parameters of my pipeline ? 
    My pipeline propose 2 parameters -->  windowStart & WindowEnd

    I describe my 2 parameters in the request but the execution does not succeed because of a bad description of these last ones

    My query --> Select A.* , ISNULL(B.Type_Vente_PK,0) as Type_Vente_FK  from [dbo].[Ventes]  A Left JOIN [dbo].[DimTypeVente] B ON A.Type_Vente = B.Type_vente  Where CAST(Date_facture AS Varchar(10)) >=  @pipeline.parameters().windowStart and CAST(Date_facture AS Varchar(10)) <= @pipeline.parameters().windowEnd

    Thanks a lot for help and regards 

    Thursday, February 22, 2018 11:06 AM

All replies

  • Please check the reference at https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-function

    Expressions can also appear inside strings, using a feature called string interpolation where expressions are wrapped in @{ ... }. For example: "name" : "First Name: @{pipeline().parameters.firstName} Last Name: @{pipeline().parameters.lastName}"

    For your case, it shall be 

    My query --> Select A.* , ISNULL(B.Type_Vente_PK,0) as Type_Vente_FK  from [dbo].[Ventes]  A Left JOIN [dbo].[DimTypeVente] B ON A.Type_Vente = B.Type_vente  Where CAST(Date_facture AS Varchar(10)) >=  @{pipeline.parameters().windowStart} and CAST(Date_facture AS Varchar(10)) <= @{pipeline.parameters().windowEnd}

    Saturday, March 3, 2018 11:47 AM