Handling Cascade Delete
nagornyiOct 24 2007 — edited Oct 24 2007I need to delete a record with the given value of ID field (PK) from table A. There are several dozens of tables where ID is used as FK. I was thinking about writing a procedure that deletes records from all children tables, and then deletes from the parent. However, some of those child tables have other tables referred to them, and so on. So it is a pretty evolved tree structure. What's the best way of handling this kind of delete? Is there alternative to uncovering entire tree structure and doing all deletes from bottom up?