Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 'Subquery returned more than 1 value' error

Author  Topic 

allan8964
Posting Yak Master

249 Posts

Posted - 2012-06-07 : 13:24:00
Hi there,

When I run code as below:

update table1
set col1 = 'TEST'
where col2 = 'DEMO'


I got error msg as "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."

subquesry as Where clause should return more than one value here, why did I get the error? I have no problem to run this same code to other tables. What should I check? Thanks in advance.

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-06-07 : 13:31:46
Check for triggers on the table.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

allan8964
Posting Yak Master

249 Posts

Posted - 2012-06-07 : 13:59:11
thanks for reply, just found this link: http://stackoverflow.com/questions/149124/sql-server-2000-subquery-returned-more-than-one-value-on-an-update-statement
I changed the trigger ... ok, now!
Go to Top of Page
   

- Advertisement -