Home > Database > Mysql Tutorial > mssql 触发器代码

mssql 触发器代码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:47:16
Original
1176 people have browsed it

mssql 触发器代码

create trigger depart_update
on depart
for update 
as
begin
update t set t.部门号=i.部门号 from worker t, inserted i ,deleted d where t.部门号=d.部门号
end

create trigger worker_delete
on worker
for delete 
as
begin
delete t from salary t, deleted d where t.职工号=d.职工号
end


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

*/

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template