create trigger trig_aa_update on aa
for update
as 
update aa set 字段='' from inserted where aa.主键=inserted.主键

解决方案 »

  1.   

    create trigger trig_aa_update on aa
    for update
    as 
    update aa 
    set 字段='' from inserted ,aa 
    where aa.主键=inserted.主键
      

  2.   

    --替代触发器
    create table a (a int,aa varchar(100))
    create table b (b int,bb varchar(100))
    go
    create view c
    as
    select a.*,b.* from a,b where a.a=b.b
    go--测试:
    insert c values(1,'aa',1,'bb')
    --失败go
    CREATE TRIGGER 名 on c
    INSTEAD OF INSERT
    AS
    BEGIN
      INSERT a select a,aa from inserted
      INSERT b select b,bb from inserted
    END
    go--测试:
    insert c values(1,'aa',1,'bb')
      

  3.   

    CREATE TRIGGER 名 on 你的表
    INSTEAD OF insert
    AS
    BEGIN
      insert 你的表 (列1,列2) select 列1+1,列2+'ss' from inserted
    END
      

  4.   

    我的问题是对当前行过行UPADTE不是INSERT