# Primary key errors

**URL:** <https://forum.servoy.com/t/primary-key-errors/746>\
**Category:** Classic Servoy\
**Created:** [November 24, 2003, 5:03pm UTC](https://forum.servoy.com/t/primary-key-errors/746 "2003-11-24T17:03:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpwiedemann](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mpwiedemann](https://forum.servoy.com/u/mpwiedemann)\
**Post date:** [November 24, 2003, 5:03pm UTC](https://forum.servoy.com/t/primary-key-errors/746/1 "2003-11-24T17:03:26Z")

</div>

Hello all,

Using Servoy 1.2 rc9 on WinXP w/ MS-SQL2000 as repository. We keep getting PK errors such as :

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Violation of PRIMARY KEY constraint ‘PK\_servoy\_uuids’. Cannot insert duplicate key in object ‘servoy\_uuids’.

We also get the same sorts of errors in the Servoy\_Elements table when attempting to add elements to a form.

Thanks in advance,  
Martin

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [November 24, 2003, 9:00pm UTC](https://forum.servoy.com/t/primary-key-errors/746/2 "2003-11-24T21:00:18Z")

</div>

This seems quite unlikly to us this happens out of the blue…did you do anything in the servoy\_XXXX tables yourself?  
When did/does this happen?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/363c5924e316baabbea11f046f1e2f3db64fbf70.jpeg) [@system](https://forum.servoy.com/u/system)\
**Post date:** [November 24, 2003, 9:06pm UTC](https://forum.servoy.com/t/primary-key-errors/746/3 "2003-11-24T21:06:19Z")

</div>

Only the upgrade to 1.2 rc9

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [November 24, 2003, 9:15pm UTC](https://forum.servoy.com/t/primary-key-errors/746/4 "2003-11-24T21:15:31Z")

</div>

I _think_ something similar has happened to me. It’s hard to tell because I just fixed the problem and didn’t delve to deep into the reasons. But it was just after installing a new version over an older version and some of the tables in a solution with a connection to MySQL lost their primary key sequence. You’ll have to search for the highest current pk value and reset your pk incrementation accordingly.

The next time I upgrade my production server, I am going to export all of my solutions, do a clean install, recreate all custom data connections, and then import the solutions.

- david

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [November 24, 2003, 9:59pm UTC](https://forum.servoy.com/t/primary-key-errors/746/5 "2003-11-24T21:59:26Z")

</div>

> Anonymous:  
> Only the upgrade to 1.2 rc9

Seems very unlikly to us, so many upgraded there repository…

> …tables in a solution with a connection to MySQL lost their primary key sequence…

Is not related to a repository update.

But is it possible for us to get a db dump/db backup of that repository?

---

<div class="post-metadata">

**Author:** ![david](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@david](https://forum.servoy.com/u/david)\
**Post date:** [November 24, 2003, 10:09pm UTC](https://forum.servoy.com/t/primary-key-errors/746/6 "2003-11-24T22:09:15Z")

</div>

In my case, it has been several months since it has happened so no old backups left. I did have it happen a number of times though so I’ll try to be aware of the situation if it comes up again.

- david
