早上好,我有以下查询。
它给我以下错误信息
违反UNIQUE KEY约束
'IX_Dim_Employee'
。无法在对象“ dbo.Dim_Employee”中插入重复键。重复的键值为(400613-CDMG0176,5806195814589)。
update b
set serviceno = a.serviceno,
idno = a.idno
from Fleet_StagingLive.dbo.stg_Employee a
inner join Fleet_DataMartLive.dbo.Dim_Employee b
on a.nodeid = b.nodeid
where b.nodeid <> -1 --fms
and b.nodeid <> -2 --ctrack
and a.IDNo = '5806195814589'