Violeta Popa

Violeta Popa

  • NA
  • 137
  • 161.2k

error "the insert statement conflicted with the foreign key"

Mar 21 2013 5:45 AM
hi..i have 2 tables client and user and between them it's a relationship 1:1 and i'm trying to insert a new client but i get the error: the insert statement conflicted with the foreign key constraint "FK_client_user"...etc i understand why, but i don't know how to solve it. i've thought that first i should introduce a blanc row in each table then replace the values..but i don't know how to implement that, another solution? pls i need some help.

the tables structure is:

client(client_id(pk), user_id(fk), client_type etc)
user(user_id(pk), client_id(fk), password, email)

Answers (6)