The following query is not behaving as I would expect:
UPDATE DWH.DIM_AGENT d
) = (
from STG.AGENT_HIERARCHY ah
ah.A_ID = d.A_ID
AND d.IS_CURRENT = 1
and ah.FIRST_NAME != d.FIRST_NAME
Dim_Agent is a dimension in a data warehouse and I would like to update first name only if the incoming first name is different. The query as it is sets first name on the dimension to null for all rows. If I comment out the not equal portion of the where clause, it updates all rows in the dimension as I would expect, but I would like to only update rows which have changed.