简体   繁体   English

如何在事实表中插入 ID

[英]How to insert IDs in the fact table

i just started working with SSIS and i need some beginer help to create my datawarehouse.我刚开始使用 SSIS,我需要一些初学者帮助来创建我的数据仓库。

I got a fact table with lot of informations about: Client, Airport, dates, etc... Though, those informations don't have ID columns我有一个包含大量信息的事实表:客户、机场、日期等...虽然,这些信息没有 ID 列

By informations i mean (name, lastname, email, etc...) for client for instance例如,我的意思是客户的信息(姓名、姓氏、email 等...)

So i need to create IDs for every dimension, though i don't know how to proceed.所以我需要为每个维度创建 ID,尽管我不知道如何进行。

I was thinking about 2 solutions:我在考虑2个解决方案:

-adding ID for each dimension in the flat file before moving it to the OLE DB. - 在将平面文件移动到 OLE DB 之前,为平面文件中的每个维度添加 ID。

-I know that i could create tables with IDs for each dimension, then insert those informations in those tables, though, when i would insert my fact table, i would need those IDs in my flat file so i could map them with the different tables, thing I could not do if my file does not contain the IDs... or maybe i can map the informations in the flat file to the IDs in the created tables? - 我知道我可以为每个维度创建带有 ID 的表,然后在这些表中插入这些信息,但是,当我插入事实表时,我需要在我的平面文件中使用这些 ID,这样我就可以用不同的表对它们进行 map ,如果我的文件不包含 ID,我不能做的事情......或者我可以将平面文件中的信息 map 到创建的表中的 ID?

i don't really know, i need your help我真的不知道,我需要你的帮助

Usual DWH way is to have a separate load process for dimensions (eg Airport, Client).通常的 DWH 方式是对维度(例如 Airport、Client)进行单独的加载过程。 This runs before the fact load (unless you use the late-arriving dimension method, which is complicated).这在事实加载之前运行(除非您使用复杂的迟到维度方法)。

To do this you need to work out how to load all the eg Clients present in the system.为此,您需要弄清楚如何加载系统中存在的所有例如客户端。 If the source system is not well normalised, it might something as crude as如果源系统没有很好地规范化,它可能像

SELECT DISTINCT ClientEmail,ClientFirstName,ClientLastName FROM TheMainFactSource

These then get assigned dimension IDs (normal SQL IDENTITY columns).然后这些获得分配的维度 ID(普通 SQL IDENTITY 列)。 In your fact load, you look up this ID using some unique client identifier (working out what this is the challenge, both for the dimension and fact load), and load it into a fact table ClientID column.在您的事实加载中,您使用一些唯一的客户端标识符查找此 ID(找出这是什么挑战,无论是维度加载还是事实加载),并将其加载到事实表 ClientID 列中。

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

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