gpt4 book ai didi

sql-server - SQL 服务器 2000 : "subquery returned more than one value" on an update statement

转载 作者:行者123 更新时间:2023-12-05 00:03:26 26 4
gpt4 key购买 nike

我正在尝试进行简单的更新。这种事我做过上千次了。

update articles
set department = 60
where type = 'Top Story'

今天我遇到一个奇怪的错误。

Describe Error: Failed to retrieve execution plan: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Warnings: ---> W (1): The statement has been terminated. <---

1559 record(s) affected

更新语句中没有子查询。怎么回事?

最佳答案

很可能表上有触发器,并且错误发生在触发器中,而不是在您的实际 SQL 语句中。

我敢打赌,触发器假定插入或删除特殊表只会有一行(实际上在批量更新中不是这种情况,就像您正在执行的那样),这会导致问题。

关于sql-server - SQL 服务器 2000 : "subquery returned more than one value" on an update statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/149124/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com