Page 1 of 1

Violation of PRIMARY KEY

Posted: Thu 10 Sep 2015 11:27
by Tomis
Hi

I have used this datasync to sync two tables to the server. It has worked ok until now:

Violation of PRIMARY KEY constraint 'PK__ReportDa__3214EC271D4CF30A'. Cannot insert duplicate key in object 'dbo.ReportData'. The duplicate key value is (20150811131154).

If I clear the table data from server side I can sync it once (all data) but not after that.
What could it be because it has worked before with filter timestamp > GETDATE()-30

Re: Violation of PRIMARY KEY

Posted: Fri 11 Sep 2015 06:53
by Tomis
It seems that timestamp > GETDATE()-30 is not working.

Two tables are connected with FK so when table1 is inserted one row,table 2 gets 5 rows with same ID.
Perhaps there has been writing in 0:00 or something which get the error.

Data in tables are not changing there is only new lines. How can I filter that so that I wouldn't need to compare the whole data??

Re: Violation of PRIMARY KEY

Posted: Fri 11 Sep 2015 14:45
by alexa
Could you please let us know what version of dbForge you are using?

Re: Violation of PRIMARY KEY

Posted: Tue 22 Sep 2015 06:06
by Tomis
3.8.265
I had a update windows but I think I dont have username or password.

Is there possibilty to let program just increase rows but not change anyting?

I will try this: Timestamp>CONVERT(VARCHAR(10),GETDATE()-30,112)

Re: Violation of PRIMARY KEY

Posted: Tue 22 Sep 2015 09:31
by alexa
We will review this post and will answer you as soon as possible.

Re: Violation of PRIMARY KEY

Posted: Wed 23 Sep 2015 14:10
by alexa
Could you please send us the CREATE definitions for table1 and table2 on Source and Target and a couple of records (INSERT statements) for the tables?

You can send a reply straight to our support system at supportATdevartDOTcom