INF: Example of Using Nested TriggersID: Q79886
|
The following script shows the use of nested triggers. The output shows how the inner trigger is completed before the calling trigger is completed.
use pubs
go
create table t1(a int)
go
create table t2(a int)
go
create trigger t1it on t1 for insert as
print "begin t1it"
insert t2 values(1)
/* (select count(*) from inserted) */
print "end t1it"
go
create trigger t2it on t2 for insert as
print "begin t2it"
print "end t2it"
go
insert t1 values (1)
go
begin t1it
begin t2it
end t2it
end t1it
(1 row affected)
Keywords : kbother SSrvServer
Version : 4.2
Platform : OS/2
Issue type :
Last Reviewed: March 11, 1999