L'instruction INSERT est en conflit avec la contrainte FOREIGN KEY SAME TABLE
bonjour, :D
J'ai un phénomène inquiétant:
J'ai le message T_SEG_CHUNK_FK1". Le conflit s'est produit dans la base de données "COHERENCE", table "dbo.T_SEG_CHUNK", column 'nuIdSegChk'.
L'instruction a été arrêtée
qui m'est jetté à la figure sur l'enregistrement 77 pour nuIdSegChk
Je peux faire l'insert avec SSMSM:
Code:
1 2 3
|
SET IDENTITY_INSERT [T_SEG_CHUNK] ON
INSERT INTO T_SEG_CHUNK ( nuIdSegChk, nuIdSeg, nuIdChunk, iInitPos, nuIdPrev, cAlignStatus) VALUES ( 77, 15, 53, 6, NULL, 3) |
sans que j'ai un signe de mauvais enregistrement
et le programme se plante sur la même requête
celui qui m'éclairera sera :ccool:
je réponds point par point
et merci pour ta réaction rapide
Le SGBD est de microsoft SQL Server
la table est ci_dessous
Code:
1 2 3 4 5 6 7 8 9
| T_SEG_CHUNK (
nuIdSegChk NUMERIC(18,0) not null identity,
nuIdSeg NUMERIC(18,0) not null,
nuIdChunk NUMERIC(18,0) not null,
iInitPos INTEGER not null constraint T_SEG_CHUNKiInitPos_Chk check (iInitPos >= 1) ,
nuIdPrev NUMERIC(18,0),
nuIdNext NUMERIC(18,0),
cMatchStatus CHAR(1) constraint T_SEG_CHUNKcMatchStatus_Chk check ( (cMatchStatus between '0' and '4') OR (cMatchStatus IS NULL) ) ,
cAlignStatus CHAR(1) constraint T_SEG_CHUNKcAlignStatus_Chk check ( (cAlignStatus between '0' and '5') OR (cAlignStatus IS NULL) ) , constraint T_SEG_CHUNK_PK primary key (nuIdSegChk) ); |