SQL查询更新失败
我正在尝试更新 SQL SERVER 2005 上的一行。当我运行 SQL 时,我收到一条消息,指示执行成功并且 1 行受到影响。但是,当我对应该更新的这一行进行选择时,该值保持不变。当成功的查询完全不执行任何操作时,此 SQL 服务器会发生什么情况。
查询是:
UPDATE [database1].[dbo].[table1]
SET [order] = 215
WHERE [email] = '[email protected]'
I am trying to update a row on an SQL SERVER 2005. When I run the SQL, I receive a message indicating that the Execution was successful and 1 row was affected. However, when I do a select against this row I supposedly updated, the value remains unchanged. What's going on with this SQL server when a successful query does absolutely nothing.
The query is:
UPDATE [database1].[dbo].[table1]
SET [order] = 215
WHERE [email] = '[email protected]'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查 [database1].[dbo].[table1] 上的触发器,可能它正在执行您不知道的操作。
在没有看到触发器代码的情况下编辑
,您可能只需要在触发器中添加对 [order] 的支持,因为它是一个新列(基于您的评论)。
check for a trigger on [database1].[dbo].[table1], possibly it is doing something you are not aware of.
EDIT
without seeing the trigger code, you probably just need to add support for [order] into the trigger, since it is a new column (based on your comment).
谢谢 KM,我检查了触发器,你是对的。我必须禁用一个触发器才能使 sql 正常工作。
Thanks KM I checked the triggers and you were right. There was a trigger that I had to disable to get the sql to work.