Skip to content Skip to sidebar Skip to footer

Conflict With The Foreign Key Constraint

I have two tables ACADEMIE: CREATE TABLE [dbo].[R_ACADEMIE]( [ID_ACADEMIE] [dbo].[IDENTIFIANT] NOT NULL, [LC_ACADEMIE_CODE] [dbo].[LIBELLE_COURT] NOT NULL, [LM_ACADEMIE

Solution 1:

Seems your table E_VOYAGEUR already having some values And you are altering that table to add the new column ID_ACADEMIE with default value as 0. This makes all the rows in the table E_VOYAGEUR with 0 value for the columnn ID_ACADEMIE . And when you are adding with the foreigh key constraint to that table ,reference table, [R_ACADEMIE] may not have an entry with value '0' in the column ID_ACADEMIE and that seems to be the cause of this issue.

Before adding the foreign key to the table E_VOYAGEUR,make sure the value in the column ID_ACADEMIE having references in the table [R_ACADEMIE] .

Post a Comment for "Conflict With The Foreign Key Constraint"