首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Sybase >

sybase触发器范例

2012-09-25 
sybase触发器实例create trigger trigger_allon table_afor insert,update,deleteasif not exists(select

sybase触发器实例

create trigger trigger_allon table_afor insert,update,deleteasif not exists(select * from deleted) and exists(select * from inserted)---插入begininsert into table_middle (id,kind,time) select id1,'I',getDate() from insertedendelse if exists(select * from deleted) and not exists(select * from inserted)---删除begininsert into table_middle (id,kind,time) select id1,'D',getDate() from deletedendelse if exists(select * from deleted) and exists(select * from inserted)---更新begininsert into table_middle (id,kind,time) select id1,'U',getDate()  from insertedend

热点排行