a±íºÍb±íµÄid¶¼ÊÇ ×Ô¶¯Ôö³¤µÄ µ«ÔÚa±íÖвåÈëÊý¾ÝµÄʱºò ÄܰѸÃÊý¾ÝµÄ id ²åÈë b±íÖÐ ¡£ SQL code: create trigger tri_tb_insert on a for insert as insert b(aid) select id from inserted go
°ï¶¥»Ø¸´ÄÚÈÝÌ«¶ÌÁË£¡ SQL code: create trigger f on a for insert as insert b(aid) select id from inserted go
Èç¹û¸Ä³ÉÕâÑùÄØ ÓÐÒ»¸ö±í a ( id ,c ,d) ºÍÒ»¸ö ±í b ( id ,a_id ,e,f)
a±íºÍb±íµÄid¶¼ÊÇ ×Ô¶¯Ôö³¤µÄ µ±ÔÚa±íÖвåÈëÊý¾ÝµÄʱºò ÄܰѸÃÊý¾ÝµÄ id ºÍ e ,f ²åÈë b±íÖÐ ¡£
SQL code: create trigger f on a for insert as insert b(a_id,e,f) select id,e,f from inserted go