I have 2 tables: Table1 and Table2. Both tables have a column named Column2.
I want to set all values of Table1.Column1 as NULL for all records that do not exist in Table2. I.e. all records where Table1.Column2 <> Table2.Column2.
This is the query I am trying to execute:
UPDATE a
SET a.Column1 = null
FROM Table1 a
INNER JOIN Table2 b
ON a.Column2 <> b.Column2
I get a "Token Unknown" Dynamic SQL error on "FROM" when I try to execute this query.
Any idea what I am doing wrong? I am fairly new to SQL so there is a good chance that I am using the wrong type of join.