Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Violation of PRIMARY KEY constraint on SQL Server Identity

Hi,
I have an SQL Server table with an Identity Column (named ID). I have enabled the "enable identity insert" on the relative tMSSqlOutput but when I launch the job in order to migrate data from an Access DB, I get the following error:
"Violation of PRIMARY KEY constraint 'TABLE_PK'. Cannot insert duplicate key in object 'dbo.TABLE'. The duplicate key value is (0)."
In other words, Talend adds the first row with ID 0, then it adds another row with the same ID 0.
Why it happens? Thanks

It happens because is responsability of MS SQL Server to populate the Identity Column. Remove the Identity Column from the output schema of tMap solve the problem.
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi,
Thanks for posting that you resolved it by yourself. It was quick, we didn't have the time to reply.

Best regards
Sabrina