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

One Star

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

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

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

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now