Maybe because you're not properly checking for NULL
? NULL
is not a value you can compare with the equality operator - you must use IS NULL
Try this:
SET
Account_ID = CASE
WHEN source.Account_ID IS NULL
THEN target.Account_ID
ELSE source.Account_ID
END
Use IS NULL
instead of = NULL