Skip to content
Advertisement

The INSERT statement conflicted with the FOREIGN KEY constraint “FK__Messages__Email__3D9E16F4”

Maybe someone can tell me why this is happening. I wrote this stored procedure:

Now I’m trying to check it by inserting:

and I get:

Msg 547, Level 16, State 0, Procedure Newmessages, Line 4 [Batch Start Line 0] > The INSERT statement conflicted with the FOREIGN KEY constraint “FK__Messages__Email__3D9E16F4”. The conflict occurred in database “Petfinder”, table “dbo.Users”, column ‘Email’.

Thing is, I checked and I do have the email I’m trying to insert in the Users table (which is the error).

Here I checked that it does exist in dbo.Users:

enter image description here

Does anyone know why this is still happening?

Advertisement

Answer

The email address you’re trying to insert is acprthvs.bpuzcnt@gma, which doesn’t exist in your table.

The email address you’d like to enter is 26 characters long.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement