Trigger (comprising obtaining a temporary table data)

create trigger test - create triggers the Test
the After insert ON test1 - performed first and then insert trigger
for each row - Fixed grammar
begin - execute
DECLARE A VARCHAR (20); - declare variables A
DECLARE B VARCHAR (20); - declare variables B
SET a = new.test; - assigning the temporary table test field values to insert in a
- is to obtain new new field values corresponding to the temporary table in sqlserver inserted the.
SET B = new new. id; - assigning the temporary table id field values to insert in B
the iNSERT test1_1 the SELECT a, B; - trigger insert time
eND - end

Guess you like

Origin www.cnblogs.com/liyunchuan/p/11670962.html