Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete cascade trigger

Status
Not open for further replies.

tamas

Programmer
Jul 11, 2001
4
RO
Hi,
I have a self-referencing table, something like Emlplyee-Manager. I want to implement the cascading delete in this table. So when I delete a manager than all the employees should be deleted at ANY level below the manager.
My problem is that the trigger fires only one time (for the "sons") and not for the "grandsons" and below, although the nested trigger setting checkbox is set.
Any idea why the trigger doesn't fire for "grandsons" and below?
 
Hi tamas,
In SQL, A trigger will not execute again if you update the respective table with in the trigger.
I suggest you to create a procedure for deletion of sons and grandsons and ...
And call that procedure within the trigger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top