TSQL Cascade delete for child records?

Posted by ElHaix on Stack Overflow See other posts from Stack Overflow or by ElHaix
Published on 2009-11-13T23:07:27Z Indexed on 2010/05/14 15:54 UTC
Read the original article Hit count: 963

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about sproc

Related posts about recursion