本帖最后由 smilewmr 于 2013-06-05 20:19:16 编辑

解决方案 »

  1.   

    create table A
    ( a int,
     b int,
     c int,
     d int,
     e int 
    );create table B
    (  
     b int,
     c int,
     d int 
     
    );
    CREATE TRIGGER TRI_A ON A
    AFTER INSERT
    AS BEGIN declare @a int,@b int ,@c int ,@d int ,@e int 
     select @a=a ,@b=b,@c=c ,@d=d,@e=e from inserted i
     if @a <>'' --invalid check  ,u would write yours business function to replace  it
     begin 
     
     insert into B(b,c,d) select @b,@c,@d
     
     delete a
     from A as a,inserted i
     where a.a=i.a and a.b=i.b
     
      end else begin  rollback
    endEND