Re: Trigger on Self-Referencing table
From: oj (nospam_ojngo_at_home.com)
Date: 01/24/05
- Next message: Pradeep Kutty: "Re: SELECT TOP"
- Previous message: Lia: "Record locking..."
- In reply to: tom d: "Trigger on Self-Referencing table"
- Next in thread: Hugo Kornelis: "Re: Trigger on Self-Referencing table"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 00:13:17 -0800
Instead Of trigger is fired before the insert/update/delete on the base
table, thus, it's not cascaded. This is by design. See this article for more
info.
http://msdn.microsoft.com/library/en-us/createdb/cm_8_des_08_49kj.asp
-- -oj "tom d" <tom d@discussions.microsoft.com> wrote in message news:9AFF0011-6422-4FED-972E-7061740F99A9@microsoft.com... > Let's say I have an employee table like this: > > empid name mgrid > 1 A 2 > 2 B 1 > 3 C 2 > 4 B 2 > 5 E 3 > > > I have a self FK on mgrid referencing empid. > > Question is how do I create a trigger that when I delete empid 2, it > should > automatically delete all of it subordinates. In this case, it should > delete > all employees in this table. I did try enabling Recurent trigger with > "instead of" trigger with no luck. > > Please help me with the triggers. > Thanks, > Tony
- Next message: Pradeep Kutty: "Re: SELECT TOP"
- Previous message: Lia: "Record locking..."
- In reply to: tom d: "Trigger on Self-Referencing table"
- Next in thread: Hugo Kornelis: "Re: Trigger on Self-Referencing table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|