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
396 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need some help wiht :CAST AS Double 11 47
Replace Dates in query 14 51
SQL Server Configuration Manager WMI Error 11 21
Need to find substring in SQL 5 14
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 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