Where are the cascade update/delete functions in SQL Server?

A. A. There aren't any 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

===

v1.04 2000.02.02
Applies to SQL Server versions : 4.x, 6.x, 7.0
Related FAQ articles : n/a
Related Microsoft Kb articles : Q142480
Other related information : n/a


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish