我只是在研究SCD类型2,无法以某些场景没有完全填满的方式完全实现它。我在IICS做过。真的很难涵盖所有可能的情况。因此,流程如下:
Src
---> Lkp ( on src.id = tgt.id)
---> expression ( flag= iif (isnull (tgt.surrogatekey) then Insert, iif(isnotnull(tgt.surrogatekey) and md5(other_non_key_cole)<>tgt.md5)then Update)
----> insert on flag insert(works fine)
but on update i pass updates
to 2 target instances
of same target table
in one i am updating it
as new update as insert
and in other i
am updating tgt_end_date=lkp_start_date for previously stored ids and active_ind becomes 'N'.
但是,当我再次接收到具有相同记录的新更新(意味着重复)时,这是有效的,或者只是重新运行映射在目标表中插入重复项,并且end_date的更改也变得不稳定。当我插入同一记录的多个更改时,它将所有active_flags设置为“Y”,预期的值应该是“N”,除了上次运行的最新记录。如果你能解释的话,有人能帮忙吗?即使是在SQL中。