触发器

alter trigger t_tb on tb for update
as
if(update(次数_天数))
begin
   --update tb set 次数_天数='22' where autoid='1'
   select autoid from deleted
end
 
 
 
 
 
create trigger tri_os on 表名 for update,delete
as
if exists(select 1 from inserted) and exists(select 1 from deleted)--修改时
begin
          --.........
end
if not exists(select 1 from inserted) and exists(select 1 from deleted)--删除时
begin
          --.........
end

你可能感兴趣的:(OS)