SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 'Subquery returned more than 1 value' error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

allan8964
Posting Yak Master

202 Posts

Posted - 06/07/2012 :  13:24:00  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

United Kingdom
3328 Posts

Posted - 06/07/2012 :  13:31:46  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
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

202 Posts

Posted - 06/07/2012 :  13:59:11  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000