Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Strange error about Primary Keys restriction

Author  Topic 

CybIRO
Starting Member

3 Posts

Posted - 2004-05-07 : 15:35:39
Hi.

I have this error in SQL and I have no clue about what could it be!

My SQL Server is in spanish and here is the error:

Infracción de la restricción PRIMARY KEY 'PK_Cita'. No se puede insertar una clave duplicada en el objeto 'Cita'.
Se terminó la instrucción.

I'll try to translate it to english:

Violation to PRIMARY KEY 'PK_Cita' restriction. Unable to insert a duplicate key in object 'Cita'.
Instruction Terminated.

Can anyone help me?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-05-07 : 15:48:23
Well, you are trying to create a duplicate row that is being prevented by the constraint. So let's say you have a primary key of last name, first name. And you've got a row in there that has Duggan as last name and Tara as first name. Then you try to insert another row with Duggan as last name and Tara as first name. You will got that error because it's a duplicate regardless if the rest of the row is different.

Tara
Go to Top of Page
   

- Advertisement -