Copying Data From One Column To Another In The Same Table - Subquery Returned More Than 1 Value
I have one table in this format: a | b ---------- 12.1| NULL 6.4 | NULL 55.5| NULL I want to simply copy the values from a over to b. I've reviewed other answers to this quest
Solution 1:
I'll bet your table have a trigger for update, and that trigger is what's causing this issue.
The fact is that triggers in sql server are raised per statement, not per row.
This means that for the sample data you provided, the update statement will produce an inserted table with 3 records.
I'll bet in your trigger you do something like this:
select @localVariable = a from inserted.
This is what's causing the problem.
Post a Comment for "Copying Data From One Column To Another In The Same Table - Subquery Returned More Than 1 Value"