XtkWorkflowTask duplicated key row error | Community
Skip to main content
July 21, 2020
Solved

XtkWorkflowTask duplicated key row error

  • July 21, 2020
  • 2 replies
  • 2944 views

We recently upgraded to build 9032 and tonight was the first time I imported database schema from our test instance into our production instance. The import was successful without any errors, however, after the import all my workflows and campaigns started throwing this error. Has anyone encountered this issue before and how to resolve?

 

WDB-200001 SQL statement 'INSERT INTO XtkWorkflowTask (dMaxExecutionTime, iWorkflowId, iWorkflowTaskId, tsProcessing, tsNextProcessing, iStatus, iAbortReason, tsCompletion, iTaskIdentifier, tsCreation, tsRunning, iProcessingCount, sHostname, sActivity, i
LastErrorCode, iAssigneeType) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' could not be executed. Param(0)=0s Param(1)=259395 Param(2)=0 Param(3)=07/20/2020 9:35:22 PM Param(4)=07/20/2020 10:00:00 PM Param(5)=0 Param(6)=0 Para
m(7)= Param(8)=71632 Param(9)=07/20/2020 9:35:22 PM Param(10)= Param(11)=1 Param(12)=SERVERNAME Param(13)=schedule Param(14)=0 Param(15)=0
ODB-240000 ODBC error: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'xxxxxxx.XtkWorkflowTask' with unique index 'XtkWorkflowTask_id'. The duplicate key value is (0). SQLState: 23000
ODB-240000 ODBC error: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The statement has been terminated. SQLState: 01000

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manoj_Kumar_

Hello @anhg ,

 

You can refer to this documentation for how to resolve the sequence.

 

https://helpx.adobe.com/campaign/kb/sequence_auto_generation.html

 

Thanks,

2 replies

anhgAuthor
July 21, 2020

It looks like the primary id sequence for this table is reset to 0 after my schemas import (the schemas were for new custom tables and did not have any changes made to any out of the box schemas). How do I reset this primary key to start from the latest value + 1?.

_Manoj_Kumar_
Community Advisor
_Manoj_Kumar_Community AdvisorAccepted solution
Community Advisor
July 21, 2020

Hello @anhg ,

 

You can refer to this documentation for how to resolve the sequence.

 

https://helpx.adobe.com/campaign/kb/sequence_auto_generation.html

 

Thanks,

     Manoj     Find me on LinkedIn
anhgAuthor
July 21, 2020
Thank you so much _Manoj_Kumar! 9 rows of data were somehow removed from the XtkNewID table when I imported the new schemas and I had to manually add them back to the table to resolve the errors.