首页 > 其他 > 详细

触发器

时间:2020-04-18 14:48:04      阅读:40      评论:0      收藏:0      [点我收藏+]

--创建成功的触发器
create trigger trig_insert
on population_tab
after insert
as
begin
declare @salary int;
select @salary = (select b.population from population_tab b
where b.pop_id = (select max(a.pop_id) from population_tab a));
if not exists (select * from salary_tab c where c.before_salary = @salary)
insert into salary_tab(before_salary,after_salary) values(@salary,@salary);
end

触发器

原文:https://www.cnblogs.com/zhougongjin/p/12724938.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!