I am trying to update email address from table B_A to table A if email address is different in table B_A is different from table A.
the query I am trying is :
UPDATE A
SET Email = ( select [Email Address] from [B_A] where A.Email <> [B_A].[Email_Address])
where A.ID = [B_A].[ID]
and my error is :
the multi part identifier [B_A].[ID] could not be bound
how do I normalize this query to run?
Your problem looks like you are referencing a table from your inner query in your outer query. The outer statement is not aware of the B_A table because you have only defined on the inner one.
You could try something like this:
Not sure if UPDATE JOIN is available in SQL Server, but that syntax will work on other dbs.