可以用instead of 触发器来做

解决方案 »

  1.   

    insert into helpezacc(cID,vcIndex,vcFile,iLevel,iParent,bSub) 
    select '149','Convert to SO','so/helpSoconfirmQuotation.asp','2','39','0'
    union all 
    select '150','Add Quotation','so/helpSoAddQuotation.asp','2','39','0'
    union all
    ........
      

  2.   

    create trigger your_trig on youttable instead of insert
    as
    begin
      delete from yourtable where id in (select id from  inserted )
      insert yourtable select * from inserted
    end
    go
      

  3.   

    用老纳的触发器也可以。下面是一句,也可以:
    insert into helpezacc(cID,vcIndex,vcFile,iLevel,iParent,bSub) 
    select * from (
    select '149' as cID,'Convert to SO' vcIndex,'so/helpSoconfirmQuotation.asp' vcFile,'2' iLevel,'39' iParent,'0' bSub 
    union all 
    select '150','Add Quotation','so/helpSoAddQuotation.asp','2','39','0'
    union all
    ........
    ) a 
    where a.cID not in (select cID from helpezacc)