sql server trigger referencing last row -
i want write trigger in sql server insert 2 rows table2
when row inserted table1
. want use column value table1
.
so trigger looks
create trigger triggername on table1 begin insert insert end
how value of column last inserted row (the row insertion fires trigger). i.e. equivalent of 'referencing row' in oracle
triggers in sql server fire per statement not per row. there 2 pseudo tables inserted
, deleted
can use (for insert
trigger 1 of interest inserted
)
create trigger yourtrigger on table1 insert insert table2 select * inserted /*this contain multiple rows if multi-row insert*/
Comments
Post a Comment