When I comment the 'WHEN NOT MATCHED' part I see that the update has been properly done (for values that already exist in the DB). But when I un-comment this part, the error 'Duplicate unique prime key error in MY_DB.MY_TABLE' appears (again, for values that already exist in the DB). Thus, it is updating AND inserting for a given set of values (????)
Has anybody experienced something like this? Is this a TD bug? Am I doing something wrong? Am I overlooking something?