如何修复触发器问题删除代码仍然有效? [英] How to fix triggers Problem deleted code is still work?
本文介绍了如何修复触发器问题删除代码仍然有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为插入创建了触发器。但有些条件和一些代码有一点问题,所以我删除了这个条件和代码。但这个条件和代码仍然有效。
示例;
I''m created trigger for insert. but some condition and some code have a little problem so i deleted this condition and code. but this condition and code is still work.
example;
CREATE TRIGGER [dbo].[TRG_INSERT_table]
ON [dbo].[tb_table]
FOR INSERT
AS
BEGIN
IF --Condition 1
BEGIN
--Some Code doing here
--This code is ok
END
ELSE
BEGIN
IF --Condition 2
BEGIN
--Some Code doing here
--This code is ok
END
---#####This code block was deleted####----
---but still work in my database----------
ELSE
BEGIN
IF --Condition 3
BEGIN
--Some Code doing here
--This code have some problem
END
END
-----############---------------------
END
END
推荐答案
看起来您缺少条件的END语句 - 2如果......
也许是因为你的SQL程序中有错误使用旧版本?我不确定SQL是否可以这样工作......
Looks like you are missing an END statement for the condition-2 if...
Perhaps because you have an error in your SQL procedure its using an older version? I''m not sure if SQL works like that or not...
这篇关于如何修复触发器问题删除代码仍然有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文