Solved

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

Posted on 2009-05-13
4
398 Views
Last Modified: 2012-05-06
I am hoping someone can explain how to correctly update multiple records in a table using subqueries.

I have one table that 2 fields. The subqueries are returning the correct values for the set and the Where Exists is returning the correct records to update.

any help is greatly appreciated.
UPDATE    TempFinalTubeListMoves
	SET              DestRackRow =
							  (SELECT     TempRecompileLastRackPositions.Row AS DestRackRow
								FROM          TempLastDestRack INNER JOIN
													   TempRecompileLastRackPositions ON TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
													   TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc), 
						  DestRackColumn =
							  (SELECT     TempRecompileLastRackPositions.Col AS DestRackCol
								FROM          TempLastDestRack AS TempLastDestRack INNER JOIN
													   TempRecompileLastRackPositions AS TempRecompileLastRackPositions ON 
													   TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
													   TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc)
	WHERE  EXISTS  
							  (SELECT     *
								FROM          TempLastDestRack AS TempLastDestRack INNER JOIN
													   TempRecompileLastRackPositions AS TempRecompileLastRackPositions ON 
													   TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
													   TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc)

Open in new window

0
Comment
Question by:TraciShultz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 
LVL 6

Expert Comment

by:bull_rider
ID: 24381324
Its the same question you are asking again but for different query. Have the answer here:

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL-Server-2005/Q_24405310.html
0
 
LVL 6

Expert Comment

by:bull_rider
ID: 24381385
Can you mark it answered here as well?
0
 
LVL 6

Expert Comment

by:bull_rider
ID: 24381643
Hi TraciShultz,

Could you please mark this question answered?

Thanks.
0
 
LVL 6

Accepted Solution

by:
bull_rider earned 500 total points
ID: 24387085
Please mark the question answered.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question