Hi all,

To perform the delete data from Product table by ProductID of Adventure Works database needs to use delete cascade. Has anyone done this yet? Can provide for me examples to do it?

Thanks a lot!

Cascading delete is something that you set up when you are creating your referential integrity constraints. If it isn't set up, you have to alter your constraint to include the clause "ON DELETE CASCADE". Look in the SQL Help system, and search using the term "table_constraint". It has full syntax there.

CAUTION: Cascading delete is not considered a best practice, because if not used very carefully, you can "accidentally" delete large amounts of data. Not only that, but if not used very carefully, you can cause your database to perform very poorly.

Hope this helps. Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.