I have the following query:
update UpdCmmPartnerArticleGroup
set IsActive = 1,
Name = a.GroupName
from
(
select t.Name as GroupName
from @ArticleGroupsTable t
left join UpdCmmPartnerArticleGroup s on s.PartnerID=t.PartnerID and s.Name=t.Name
where s.PartnerID is null
) a
where Name = '' and IsActive = 0
It's purpose is to take a list of GroupNames and assign them to the UpdCmmPartnerArticleGroup.Name
field. The list has 8 values and it uses only the first and the last to update.
What am I doing wrong, it looks pretty straight forward, but it's behavior is strange.