Cascade Delete

Cascade Delete

Post by Marc Dziedzi » Fri, 05 Feb 1999 04:00:00



Hi all,

    I have a need to perform a cascading delete via a trigger.  The problem
is that the initial delete from the table violates a foreign key constraint.
Is there any way to perform a "Before Delete" action in a trigger in SQL
Server?

Thanks -- Marc

 
 
 

Cascade Delete

Post by Tibor Karasz » Fri, 05 Feb 1999 04:00:00


Marc,

No, SQL Server does not implement "before" triggers.

Remove your foreign keys, disable them (NOCHECK) or perform cascading in sp
or client app.....

--
Tibor Karaszi
MCSE, MCSD, MCT, SQL Server MVP
Cornerstone Sweden AB
Please do not respond by e-mail unless explicitly asked for.


>Hi all,

>    I have a need to perform a cascading delete via a trigger.  The problem
>is that the initial delete from the table violates a foreign key
constraint.
>Is there any way to perform a "Before Delete" action in a trigger in SQL
>Server?

>Thanks -- Marc