You are trying to Delete the record from a Table which has a reference in another Table.
Here
REFERENCE
constraint is "
FK_User_History_Tbl_Customer
".
Tables are
User_History
and
Tbl_Customer
.
UserId
column is referenced by
Tbl_Customer
Table.
When you try to delete a row from
User_History
Table, it comes to know that the same row has some related row in
Tbl_Customer
Table.
So, you need to delete from
Tbl_Customer
Table first and then delete from Table
User_History
.
If you want to delete a row, then you have to execute the following two queries in sequence.
DELETE FROM Tbl_Customer
WHERE UserId = [[[UserIdToDelete]]];
DELETE FROM User_History
WHERE UserId = [[[UserIdToDelete]]]