June 28, 2004 at 6:30 am
Hi evryone
I have the folowing problem
I have two columns id (varchar 20) and parent(varchar 20) in table adreses
Table has 20000 rows and some values in parent column are *
I want those rows to change to x
So this query works fine:
select parent from adreses where parent='*'
but the updete query return error:
update adreses
set parent='x'
where parent= '*'
This is error:
Server: Msg 512, Level 16, State 1, Procedure TR_PromenaAdresnihPodataka, Line 13
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.
Why???
Thanks
June 29, 2004 at 12:13 am
Hey there,
I assume by this problem, that you have a trigger on this table.... Even if this is not the case, your query is, for some reason, trying to update multiple rows at a time.
One way to sort this out would be to perform a query similar to this:
UPDATE
Address
SET
Parent = 'X'
WHERE
[ID] IN
(
SELECT
[ID]
FROM
Address
WHERE
Parent = '*'
)
Hope this helps you out.
Anton
June 29, 2004 at 12:39 am
Thanks a lot
The problem was with triger
Alex
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply