【问题标题】:Azure data factory and stored procedureAzure 数据工厂和存储过程
【发布时间】:2016-03-01 21:38:21
【问题描述】:

我遇到了 Azure 数据工厂和存储过程的问题。

我已将 SP 设置为输入数据的接收器:

"sink": {
                        "type": "SqlSink",
                "sqlWriterStoredProcedureName": "spAddProducts",
                    "storedProcedureParameters": {
                        "stringProductData": {
                            "value": "str1"
                        }
                    },

在执行后我必须处理大约 200k 条记录,但是在处理了一些有限数量的行(大约 10k)之后,我得到了错误:

Copy activity met invalid parameters:
ErrorCode=InvalidParameter,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,
Message=The value of the property '' is invalid: 'The SqlParameter is already contained by another
SqlParameterCollection.'.,Source=,''Type=System.ArgumentException,
Message=The SqlParameter is already contained by another SqlParameterCollection.,Source=System.Data,'.

SP 代码:

CREATE PROCEDURE spAddProducts @DimProducts [dbo].[ProductsType] READONLY, @stringProductData varchar(256)
AS
BEGIN

MERGE [dbo].[DimProducts] AS tpr
    USING @DimProducts AS spr
    ON tpr.ID = spr.ID
WHEN MATCHED AND (tpr.Name <> spr.Name OR tpr.NameInternational <> spr.NameInternational OR tpr.ProductType <> spr.ProductType) THEN 
    UPDATE SET tpr.Name = spr.Name, tpr.NameInternational = spr.NameInternational, tpr.ProductType = spr.ProductType
WHEN NOT MATCHED THEN 
    INSERT (Name, NameInternational, ProductType, ID) 
    VALUES(spr.Name, spr.NameInternational, spr.ProductType, spr.ID)
;
END

【问题讨论】:

  • 我注意到您的存储过程没有使用第二个参数 stringProductData。这是必需的吗?

标签: azure stored-procedures azure-data-factory cortana-intelligence


【解决方案1】:

我来自产品团队。我们发现了这个问题,上周已经部署了修复程序。感谢您报告缺陷。

【讨论】:

  • 你能使用 ADF 运行存储过程吗?我收到Error Number '156'. Error message from database execution : Incorrect syntax near the keyword 'select'. Must declare the table variable "@a".。使用相同的方法。
  • 我在存储过程中使用 merge insert else update 语句并使用了用户定义的表类型...任何帮助????
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-03
  • 2022-09-25
  • 1970-01-01
  • 2022-10-24
  • 2020-11-22
相关资源
最近更新 更多