There is a dataset. It has two tables and contains a foreignkey constraint between the two tables. During the data insertion, the primary key of the parent table is changed. Will the change be affected in the child table
before inserting the child data?
.NET Programming
Last Comment
guvera
8/22/2022 - Mon
guvera
Hi,
Are your relationships using
ON UPDATE CASCADE If they are then changing the key in the primary table will update the foreign keys.
e.g.
ALTER TABLE Books ADD CONSTRAINT fk_author FOREIGN KEY (AuthorID) REFERENCES Authors (AuthorID) ON UPDATE CASCADE
Are your relationships using
ON UPDATE CASCADE If they are then changing the key in the primary table will update the foreign keys.
e.g.
ALTER TABLE Books ADD CONSTRAINT fk_author FOREIGN KEY (AuthorID) REFERENCES Authors (AuthorID) ON UPDATE CASCADE
Hope it may helpful to you.
Thanks
Guvera