Bonjour,
J'essaye de faire un insert tout bête dans une table créé par ce script :
La table contient d'ailleurs déjà 4 enregistrement, elle semble donc correcte.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 create table TRACE_LIGNE_PIECE ( TLP_ID int identity, LP_ID int not null, UNI_ID int not null, SERLOT_ID int null, TLP_QTE numeric(10,3) null, TLP_QTE_REF numeric(10,3) null, constraint PK_TRACE_LIGNE_PIECE primary key (TLP_ID), constraint FK_TRACE_LI_TLP_UNITE_UNITE foreign key (UNI_ID) references UNITE (UNI_ID), constraint FK_TRACE_LI_TLP_SERIE_SERIE_LO foreign key (SERLOT_ID) references SERIE_LOT (SERLOT_ID), constraint FK_TRACE_LI_TLP_LIGNE_LIGNE_PI foreign key (LP_ID) references LIGNE_PIECE (LP_ID) on delete cascade )
Selement voilà cette requête :
insert into TRACE_LIGNE_PIECE( LP_ID, UNI_ID, TLP_QTE ) values( 173, 1, 1 )
Me renvoye :
Impossible d'insérer une valeur dupliquée dans un index unique. [ Table name = TRACE_LIGNE_PIECE,Constraint name = PK_TRACE_LIGNE_PIECE ]"
Un peu étonnant pour un champs identity![]()
Quelqu'un a une idée svp ?
(Pour info je suis sur SqlServeurCe)
Merci![]()
Partager