I have two tables like below. Parent and child relation.
Parent table:
parent_id
is primary key auto generated
Child table:
parent_id
, child_id
primary keys and parent_id
is foreign key
When I am trying to insert new row in primary table, child table also its inserting (working fine). When I am trying to update parent table using merge operation, in child table not able to insert new row but able to update the existing rows and getting the below error.
Cannot insert the value NULL into column
parent_id
, tableTest.Sample.child
; column does not allow nulls.
INSERT fails.