create trigger UpdateTJ
on RCXQ
for update
as
 if update(TJ)
begin
 update RCXQ set TJ='0'
 from RCXQ,inserted
 where RCXQ.id<>inserted.id and RCXQ.ZPDW=inserted.ZPDW
end

 

该触发器功能为:如果修改了TJ这个字段的值(一般为1,因为这里是一个复选框),那么就把和这个字段有一样属性的zpdw的(如都是同一家公司的)所有记录的但不包括我修改的这条记录全部的TJ字段都设置为0.

相关文章:

  • 2021-07-20
  • 2022-01-08
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2021-09-18
  • 2022-12-23
  • 2022-01-09
  • 2022-03-07
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案