TSQL Cascade delete for child records?
I have a parent/child table (simple tree) table structure (ID, ParentID), where I want to delete (and get the ID of) all children for a given parent ID - similar to this post http://stackoverflow.com/questions/1433808/sql-server-cascade-delete-and-parent-child-table .

During the loop, where I've got the current ID, I will also be performing other actions with this ID.


Can someone give me an example of the SPROC to accomplish this?


Thanks
TSQL Cascade delete for child records?
===

I have a parent/child table (simple tree) table structure (ID, ParentID), where I want to delete (and get the ID of) all children for a given parent ID - similar to this post http://stackoverflow.com/questions/1433808/sql-server-cascade-delete-and-parent-child-table .

During the loop, where I've got the current ID, I will also be performing other actions with this ID.


Can someone give me an example of the SPROC to accomplish this?


Thanks