View Full Version : SQL Key violation error on EmployeeNo greater than 42


AusJonathan
02-24-2009, 03:42 PM
Ok, I've been through the forums many times, and never come across anything like this. Bear with me, its fairly complex:

I am receiving an SQL INSERT error "Table key violation" when i try and insert an SQL Statement to one of my tables (Its one of those joining entity ones), the field is EmployeeNo, its a double.

The issue is that the code and the table are fine:
INSERT INTO TabCertificateEntity (EmployeeNo, CertificateNo, ExpiryDate) VALUES (15, 1272, '25/02/2009'); [Example of code]

I then traced the issue back and found that any EmployeeNo less than 43 had an error. For everything above that, there is no "Table key violation"!

Further back, i had the EmployeeNo's starting at 42 (i like the number), but updated the records with the proper employee numbers, once i got them.

So in short, every Employeeno that is less than 42 has a table key violation, everything above that is fine.

Help? I'm stuck... :confused:

AusJonathan
02-24-2009, 03:54 PM
Ok, just solved my own post. I had a table for reports that had redundant data from before the update that was inconsistent with the new employeeno information.