简体   繁体   中英

Azure data factory and stored procedure

I've got problem with Azure Data Factory and Stored Procedure.

I've set SP as sink for input data:

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

and after execution I've got to process about 200k records, but after some limited number of processed rows (about 10k), I've got error:

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 code:

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

I'm from the product team. We identified the issue and the fix has been deployed last week. Thanks for reporting the defect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM