cascading delete with Store Procedure
Hi All !
I have a database table for products which contains data of all products with thir Category, Sub-Category, name etc up to the nth level.
Structure as follows:
Product ID | Product Name | ParentCategory ID
-------------------------------------------------------------------------
0001 | Top Product | NULL
0002 | Prod1 | 0001
0003 | Prod4 | 0001
0004 | Prod55 | 0003
Here with this table structure I want to use a Store Procedure where If I delete a particular product, then if that product is the parent of any other product that product will also be deleted simultaneously until no products remain in that heirarchy.
Can anyone provide me the Store Procedure code.
Thanks in advance
|