troubleshooting Question

MS SQL update problem

Avatar of QuinnDester
QuinnDesterFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL Server 2005SQL
3 Comments1 Solution204 ViewsLast Modified:
I want to update about 150 rows in a table.

I cant understand why this isnt working I tryed writing the update in 2 ways both gave the same error see below

i have entered both queries in the code block

update MyTable set thisfield = 'thisText' where thatField = 'thatText')

Msg 512, Level 16, State 1, Procedure COMMISIONTYPE, Line 4
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.
update MyTable set thisfield = 'thisText' where thatField = 'thatText'
 
 
update MyTable set thisfield = 'thisText' 
where thisRowid in(
select thisRowid from MyTable 
where thatField = 'thatText')
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros