Azure数据工厂存储过程参数

时间:2018-01-07 07:31:16

标签: azure-data-factory

我正在为Azure Data Factory编写存储过程,并且需要将日期作为字符串传递,例如:' 2017年11月'。

我已尝试过以下操作,但我在这行代码中遇到以下错误:

WHERE FiscalMonth = @FiscalMonth;

ErRror:

  

此子句的表达式必须是bool类型

代码:

DECLARE @FiscalMonth string = DateTime.Today.AddMonths(-2).ToString("MM") + "," + DateTime.Today.AddMonths(-2).ToString("yyyy");

    @Input =

        EXTRACT [TPID] int,
                FiscalMonth string,
                ProductGroup string,
                [Workload Customer Age] int,
                [Entitlements] int,
                [Field Activations Capped] int,
                [Field Activiations Uncapped] int,
                [True Activations Capped] int,
                [True Activations Uncapped] int,
                [CappedFlag] string,
                [AOM_Status_Current] string,
                [AOM_Status_Historical] string
        FROM @DeltaPublishOutputPath
        USING Extractors.Text(delimiter : '\u0001', rowDelimiter : "\r", nullEscape : "#NULL#", silent : true);

@Output =
    SELECT of. *
    FROM @Input AS of
    WHERE FiscalMonth = @FiscalMonth;

1 个答案:

答案 0 :(得分:0)

结束我需要添加一个doulbe =标志。这是更新的行。

在哪里FiscalMonth == @FiscalMonth