UPDATE based on if value exist in another table
Yes. You need to update using a join like this:
update t2
set t2.Another = 'ZZZ'
from table1 t1
join table2 t2 on t1.Number = t2.Number
You can use exists
also.
Query
update t1
set t1.[Another] = 'ZZZ'
from [TableB] t1
where exists(
select 1 from [TableA] t2
where t1.[Number] = t2.[Number]
);
You can use directly SELECT FROM table1 and update into table2 :
UPDATE table2 SET Another = 'ZZZ'
FROM table1 t1 WHERE t1.Number = table2.Number