Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

correlated subquery and UPDATE 1

Status
Not open for further replies.

petperson

Programmer
Oct 2, 2002
106
US
any idea why this:

update individual
set referenceid = 11
where individualid in (select refid from ref_temp2)

would generate the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <= , >, >= or when the subquery is used as an expression.
The statement has been terminated.

thx
 
sure, you have a trigger on that table with bad code
in the trigger you have the classic trigger n00b code which looks like this

set @Var = Name from inserted


remember triggers fire per statement not per row

show the trigger code and we might help you correct that

Denis The SQL Menace
--------------------
SQL Server Code,Tips and Tricks, Performance Tuning
SQLBlog.com, Google Interview Questions
 
trigger was the problem..thanks for pointing it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top