Re: Update Cascade trigger
Posted in 1998
This is a multipart message in MIME format --------------InterScan_NT_MIME_Boundary Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable Before the update, you could use SET CONSTRAINTS FOR table DISABLED,=20 then SET CONSTRAINTS FOR table ENABLED afterwards, to turn off=20 constraint checks=2E =20 HTH Davin ______________________________ Reply Separator ____________________________= _____ Subject: Update Cascade trigger Author: PC {peter=2Emarley@acco-uk-co=2Euk} at INTERNET Date: 01/04/98 11:28 Hi, =20 I don't think this can be done, but I wonder if anybody has a workable=20 solution=2E =20 I have four tables with a parent / child relationship, with the unique key=20 to each table being made in part from the key to the parent=2E =20 table A ---> table B ---> table C ----> table D =20 with table A being the parent to table B table B being the parent to table C=20 table C being the parent to table D =20 If a value in table A needs to be changed all the associated rows in table=20 B, C and D also need to be changed, but obviously the parent/child=20 constraints will not allow the change to happen, because the rows in B=20 would be referencing the 'old' value in table A which would invalidate the=20 constraint etc=2E =20 What I would like is some way to cascade the update before the constraint=20 rule takes hold, but I don't think this is possible=2E =20 One way would be to drop all constraints, write SQL to do all the updates=20 and then reapply the constraints, which is a bit messy=2E =20 Can anyone supply a better method? =20 Thanks in advance =20 --=20 Peter __________________________________ Peter Marley DBA, Acco UK Ltd Tel:+44 (0)1296 397444 ext=2E 4098 Fax:+44 (0)1296 311019 email: peter=2Emarley@acco-uk=2Eco=2Euk =20 =20 =20 ********************************************************************** DST International Tel:+44 181 390 5000 www=2Edstinternational=2Eco=2Eu= k=20 This message and any attachments to it is intended only for the=20 individual or company to which it is addressed and may contain=20 information which is privileged, confidential or prohibited from=20 disclosure or unauthorised use=2E If the recipient of this=20 transmission is not the intended recipient, or the employee or agent=20 responsible for delivering such materials to the intended recipient,=20 you are hereby notified that any use, any form of reproduction,=20 dissemination, copying, disclosure, modification, distribution and/or=20 publication of this e-mail message or its attachments other than by=20 its intended recipient is strictly prohibited by the sender=2E =20 If you have received it in error, please notify us immediately by=20 telephone on the number above and destroy the message and all copies=20 in your possession=2E ********************************************************************** --------------InterScan_NT_MIME_Boundary--