This topic is locked
[SOLVED]

 Deleting Children records when Parent Record Deleted

1/26/2018 3:04:59 PM
ASPRunner.NET General questions
S
swiersman author

Hi All,
Is there any way to have the child records delete in one table when the parent is deleted in the another?
Example: I have parent table that that supports each Deployment. I have a child table that supports each task within the deployment and its detail.
Currently when I delete a record in the parent table, the child records still exist and become orphaned.
Any help would be appreciated...
Scott

M
Mack88DevClub member 1/26/2018



Hi All,
Is there any way to have the child records delete in one table when the parent is deleted in the another?
Example: I have parent table that that supports each Deployment. I have a child table that supports each task within the deployment and its detail.
Currently when I delete a record in the parent table, the child records still exist and become orphaned.
Any help would be appreciated...
Scott


Sounds like this is a database problem ... have you set up your relational database to maintain referential integrity? This would normally prevent master records being deleted whilst detail records exist and so avoid the orphan problem. Likewise if cascaded delete is active in your database, then deleting the master record should delete any related detail records (provided they aren't also related to a different table).
You can check if detail records exist ... refer to the ASPRunner manual (3.1.2.2 in the 9.8 manual)
Hope this helps.
Chris

I
i.NoLim 1/29/2018