cascading deletes

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

Hi Eric,

Is there an option within sql server 7 that allows one to set deletes to be cascading to all dependent tables from your parent table? at this point i can only think of creating triggers for all tables with relationships,

thanks in advance.

-- Anonymous, April 11, 2000

Answers

Efren,

Neil Pike, MVP/MCSE of Protech Computing Ltd. provides this answer:

There aren't any [cascading deletes] I'm afraid. These were initially thought to be going into SQL 7.0 but will now only be in SQL 2000 - due by the end of 1st half 2000. For now, you need to implement your own cascade functionality with triggers. See Q142480 in the Microsoft Kb for more information on this and the ways to work with foreign keys which cause problems due to the way that triggers work/fire. You can get some code samples for various sorts of triggers that implement this functionality from http://www.mcse.org.il/isql/8/triggers.ppt

http://www.mcse.org.il/isql/Maintaining%20Referential% 20Integrity.ppt

[Be sure to type the URLs all on one line without spaces.] Good Luck,

Eric

-- Anonymous, April 11, 2000


Moderation questions? read the FAQ