当前位置: 代码迷 >> PB >> pb11.5 触发器的有关问题
  详细解决方案

pb11.5 触发器的有关问题

热度:100   发布时间:2016-04-29 09:43:40.0
pb11.5 触发器的问题
SQL后台person表写有触发器,在原先pb9.0时可用dw_1.update()进行更新表.
升级成pb11.5后不能更新,提示
  Row changed between retrieve and update.

  No changes made to database.
如果触发器只有删除一个表的数据.是正常的.


附:触发器如下:



CREATE TRIGGER [delete_empwork] ON dbo.person
FOR DELETE 
AS
--删除works表中数据
  delete checkrecord from checkrecord ,deleted
  where checkrecord .id_person = deleted.id_person

--删除finger_mask 表中数据
  delete finger_mask from finger_mask,deleted
  where finger_mask .id_person = deleted.id_person

--删除w_work 表中数据
  delete w_work from w_work,deleted
  where w_work .id_person = deleted.id_person

------解决方案--------------------
SQL code
CREATE TRIGGER [delete_empwork] ON dbo.person FOR DELETE AS --删除works表中数据   if exists(select 1 from deleted d join checkrecord a on d.id_person = a.id_person)  delete checkrecord  from checkrecord ,deleted     where checkrecord .id_person = deleted.id_person --删除finger_mask  表中数据   if exists(select 1 from deleted d join figuer_mask a on d.id_person = a.id_person)  delete finger_mask  from finger_mask,deleted     where finger_mask .id_person = deleted.id_person --删除w_work 表中数据   if exists(select 1 from deleted d join w_work a on d.id_person = a.id_person)  delete w_work from w_work,deleted     where w_work .id_person = deleted.id_person
  相关解决方案