首先,如果是你给出的这个语句,即使出错,也不会提示这个错误,这种错误一般是发生在如下这样的情况:use tempdb godeclare @t table ( id int )insert @t select 1 union all select 2select * from @t where 1 = ( --这里外面是1个值,但子查询里面的ID是返回的一个记录集,即多个值,因此就会提示错误 select id from @t)但你却遇到了这个错误,因此表上可能存在一个触发器,错误也是由于触发器里的代码内容造成: 你可以这样查看触发器的内容: exec sp_helptext 'UserProcessChange' --错误提示的是第5行
句子本身没有错误,就像上面说的表中有触发器, 过程 UserProcessChange,行 5
---UserProcessChange这个是存储过程是触发器里调用?--查看引用的触发器 select * from sysobjects where parent_obj=object_id('t2') and xtype='tr'
godeclare @t table
(
id int
)insert @t select 1
union all select 2select
*
from @t
where 1 = ( --这里外面是1个值,但子查询里面的ID是返回的一个记录集,即多个值,因此就会提示错误
select id
from @t)但你却遇到了这个错误,因此表上可能存在一个触发器,错误也是由于触发器里的代码内容造成:
你可以这样查看触发器的内容:
exec sp_helptext 'UserProcessChange' --错误提示的是第5行
过程 UserProcessChange,行 5
select * from sysobjects where parent_obj=object_id('t2') and xtype='tr'