2 qq80219 qq80219 于 2016.01.21 11:12 提问

SQL死机会不会因为这个触发器引起的?
sql

ALTER TRIGGER [dbo].[salefpclear] ON [dbo].[ICTSale]
AFTER DELETE
AS
BEGIN
SET NOCOUNT ON;
DECLARE @fid int

declare tab cursor for select fid from deleted
open tab
fetch next from tab into @fid
while @@FETCH_STATUS=0

update icsaleentry set FEntrySelfI0567=0,FEntrySelfI0468=0 
from icsaleentry t1
inner join [dbo].[ICTSaleEntry] t2 on t1.FInterID=t2.fid_src and t1.FEntryID=t2.FEntryID_Src and t1.FItemID=t2.FItemID
where t2.fid=@fid
FETCH NEXT FROM tab into @fid

end
close tab
deallocate tab

1个回答

beau_lily
beau_lily   2016.01.21 13:27

确实可能的
你可以用sql语句查看一下 数据库里面的死锁表和你定义触发器的位置是不是一样就可以确认了

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!