触发器代码

*/

mssql 触发器代码

create trigger depart_永利皇宫登录网址 ,updateon departfor update asbeginupdate t set
t.部门号=i.部门号 from worker t, inserted i ,deleted d where
t.部门号=d.部门号end

create trigger worker_deleteon workerfor delete asbegindelete t from
salary t, deleted d where t.职工号=d.职工号end

/*在表depart上创建一个触发器depart_update,当更改部门号时同步更改worker表中对应的部门号;在表worker上创建一个触发器worker_delete,当删除职工记录时同步删除salary表中对应职工的工资记录;

网站地图xml地图