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 ........
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
用老纳的触发器也可以。下面是一句,也可以: 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)
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
........
as
begin
delete from yourtable where id in (select id from inserted )
insert yourtable select * from inserted
end
go
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)