sybase触发器实例- - JavaEye技术网站
create trigger trigger_all
on table_a
for insert,update,delete
as

if not exists(select * from deleted) and exists(select * from inserted)---插入
begin
	insert into table_middle (id,kind,time) select id1,'I',getDate() from inserted
end

else if exists(select * from deleted) and not exists(select * from inserted)---删除
begin
	insert into table_middle (id,kind,time) select id1,'D',getDate() from deleted
end

else if exists(select * from deleted) and exists(select * from inserted)---更新
begin
	insert into table_middle (id,kind,time) select id1,'U',getDate()  from inserted
end
郑重声明:资讯 【sybase触发器实例- - JavaEye技术网站】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——