34,587
社区成员
发帖
与我相关
我的任务
分享
DELETE FROM TABLE_TEST WHERE PRODUCTID='TEST'
服务器: 消息 512,级别 16,状态 1,过程 UserProcessChange,行 5
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。
use tempdb
go
declare @t table
(
id int
)
insert @t select 1
union all select 2
select
*
from @t
where 1 = ( --这里外面是1个值,但子查询里面的ID是返回的一个记录集,即多个值,因此就会提示错误
select id
from @t)
exec sp_helptext 'UserProcessChange' --错误提示的是第5行
select * from sysobjects where parent_obj=object_id('t2') and xtype='tr'