SQL LanguageSQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Language section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
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.