I have two tables, a destination for the update:
create table dest (value int)
insert into dest values (0)
and a source:
create table source (value int)
insert into source values (4)
insert into source values (1)
If I run this query:
UPDATE dest SET value = (select value from source WHERE 1=1)
SQL Server fails with:
Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, <, <= , >, >= ...
which is perfect. But if I run this query:
UPDATE dest SET value = source.value FROM dest INNER JOIN Source ON 1=1
... it picks randomly one of the values from source and updates dest with it.
Scary? Is there an explanation for this?