I have a table that looks like this:
I want to be able to do the following:
Delete a record and any records that would be under it. For example, if I delete Item 3, I need to delete items 4, 5, & 7 because their Parent is 3. In addition, Item 6 must go because Item 5 was deleted.
I need this to occur for any number of levels of data. Item 3 could have any number of generations of children.
I hope this all makes snese.
Anyone know how I can accomplish this?
Thanks you!
Code:
Item Parent
1 0
2 0
3 0
4 3
5 3
6 5
7 3
8 0
I want to be able to do the following:
Delete a record and any records that would be under it. For example, if I delete Item 3, I need to delete items 4, 5, & 7 because their Parent is 3. In addition, Item 6 must go because Item 5 was deleted.
I need this to occur for any number of levels of data. Item 3 could have any number of generations of children.
I hope this all makes snese.
Anyone know how I can accomplish this?
Thanks you!