Groups | Blog | Home
all groups > sql server (alternate) > february 2004 >

sql server (alternate) : Simple Update Error


Clive Foley
2/6/2004 11:48:57 PM
Hey all,

i have a students_table which i want to do a multiple update on.

Update student_table
set grant = 35000
where course_id = 2
There are lots of students in the student table which have course_id of
2.

I get this 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.

Does anyone know how to do a multiple update like this.It seems such a
simple thing but im confused

*** Sent via Developersdex http://www.developersdex.com ***
David Portas
2/7/2004 7:33:19 AM
Either you didn't post the right UPDATE statement or the table you are
updating has a trigger on it.

The error message is telling you that an UPDATE with a subquery returned
more than one value for some row in the table but the UPDATE statement you
posted doesn't have a subquery. Check if there is an update trigger on the
table. If there is then please post the trigger code and the DDL for the
table(s) involved.

--
David Portas
SQL Server MVP
--

AddThis Social Bookmark Button