[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.