Copy activity failing at sink having upsert

Jitender Kumar Chandel 21 Reputation points
2024-08-06T07:15:57.7133333+00:00

I am working on copy activity in ADF having sink as Azure SQL DB and upsert as an option.

It's failing with below error:

Failure happened on 'Sink' side. 'Type=System.NullReferenceException,Message=Object reference not set to an instance of an object.,Source=Microsoft.DataTransfer.Connectors.MSSQL,'

I have checked and the column exists at the source and sink. There are no null values at the source or sink.

"sink": { "type": "AzureSqlSink", "writeBehavior": "upsert", "upsertSettings": { "useTempDB": true, "keys": [ "Id" ] }, "sqlWriterUseTableLock": false, "disableMetricsCollection": false }, "enableStaging": false, "translator": { "type": "TabularTranslator", "typeConversion": true, "typeConversionSettings": { "allowDataTruncation": true, "treatBooleanAsNumber": false } } }

executionDetails": [ { "source": { "type": "Salesforce" }, "sink": { "type": "AzureSqlDatabase" }, "status": "Failed", "start": "8/6/2024, 12:17:35 PM", "duration": 15, "usedParallelCopies": 1, "profile": { "queue": { "status": "Completed", "duration": 4 }, "transfer": { "status": "Completed", "duration": 9, "details": { "readingFromSource": { "type": "Salesforce", "workingDuration": 0, "timeToFirstByte": 3 }, "writingToInterim": { "type": "AzureSqlDatabase", "workingDuration": 0 }, "writingToSink": { "type": "AzureSqlDatabase", "workingDuration": 0 } } } },

User's image

Azure SQL Database
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,355 questions
0 comments No comments
{count} votes

Accepted answer
  1. Smaran Thoomu 21,505 Reputation points Microsoft External Staff
    2024-08-06T10:26:07.2233333+00:00

    Hi @Jitender Kumar Chandel

    Thanks for the question and using MS Q&A platform.

    Based on the error message you provided, it seems that there is an issue with the sink side of the copy activity. The error message indicates a null reference exception, which means the code is trying to access an object that is null. I believe the issue might be related to setting the linked service of the sink dataset to Legacy. Please check this and let us know if it resolves the issue.
    User's image

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.