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
393 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now