We can use cascade delete on property for deleting data from child tables. With cascade delete on, the corresponding data gets deleted from the child table when the data from the parent table gets deleted. This saves a lot of time writing the code for deleting data from child tables. Also it can overall improve your application’s performance.
Deleting data with parentid=2 from the parent table (see above) will result in deletion of corresponding data from the child table(see below). This deletion will be handled automatically by the sql server.
You can add the cascade delete on property to the child table by this method:-
alter table tblchild
add constraint fk_parentchild foreign key (parentidFK) references tblparent(parentid)
on delete cascade;