简体   繁体   English

从SSIS中的Lookup维度使用SCD2加载事实表

[英]Loading Fact table with SCD2 from Lookup dimension inSSIS

I am having trouble loading a dimension with the Datawarehouse Surrogate Key in the fact table for instance the SCD Dimension I am looking up has 1002 rows, 2 rows which have had changes of SCD2 and the rest as SCD1. 我在事实表中使用Datawarehouse Surrogate Key加载维度时遇到了麻烦,例如我正在查找的SCD维度有1002行,其中2行已更改了SCD2,其余的已更改为SCD1。 When I use the Lookup transformation in SSIS to being back both, it only brings up 1000 rows when it should bring 1002. I am looking up the BusinessKey and bringing back the DWH surrogate key. 当我在SSIS中使用Lookup转换同时返回两者时,当它应该带来1002时,它仅带来1000行。我正在寻找BusinessKey并带回DWH代理键。 The problem lies is because I am using the Business Key as a lookup join to bring the DWH Surrogate key, I am certain the Lookup tranformation removes the duplicate Business Key as there are going to be 4 rows which are duplicated.Is there any way around this? 问题在于,因为我使用业务密钥作为查找联接来带来DWH代理密钥,所以我确定查找转换会删除重复的业务密钥,因为将有4行被重复。这个? Or am i doing it completely wrong 还是我做错了

A lookup in SSIS will match only once, the first match, even if there are 2 occurences. 即使有2次出现,在SSIS中的查找也只会匹配一次,即第一个匹配。 Altering this behavior of the lookup in SSIS is not possible. 无法在SSIS中更改此查询行为。

Before loading your fact table in SSIS, you can prepare the data at SQL level, for example with a view. 在将事实表加载到SSIS中之前,您可以在SQL级别(例如,使用视图)准备数据。 In the query you can lookup (by joining to dimensions) your values by business key and an extra criterium which could be between start and end date in order to get the right surrogate key. 在查询中,您可以(通过连接到维)通过业务关键字和附加条件(可以在开始日期和结束日期之间)查找值,以获取正确的代理键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM