1
我有一個遞歸觸發器,似乎正是我想要它沒有遞歸,但是當我把遞歸上我得到的錯誤:「最大存儲過程,函數,觸發器或(限制32)「如何調試遞歸觸發器
這不應該發生,因爲我期望2層或3層嵌套,所以我需要調試觸發器並計算出究竟發生了什麼。我添加了打印語句,但這不起作用...
你如何去調試遞歸觸發器?
ALTER TRIGGER [dbo].[DataInstance2_Trigger]
ON [dbo].[DataInstance]
AFTER UPDATE
AS
BEGIN
UPDATE DataInstance
SET
DataInstance.IsCurrent = i.IsCurrent
FROM DataInstance di
Inner join DataContainer dc on
di.DataContainerId = dc.DataContainerId
Inner join Inserted i on
dc.ParentDataContainerId = i.DataContainerId
WHERE di.IsCurrent != i.IsCurrent
declare @x int
SET @X = (select max(DataContainerId) from Inserted)
print @X
END
甜,是的,這是問題! – 2010-07-11 23:11:31