简体   繁体   中英

How to insert IDs in the fact table

i just started working with SSIS and i need some beginer help to create my datawarehouse.

I got a fact table with lot of informations about: Client, Airport, dates, etc... Though, those informations don't have ID columns

By informations i mean (name, lastname, email, etc...) for client for instance

So i need to create IDs for every dimension, though i don't know how to proceed.

I was thinking about 2 solutions:

-adding ID for each dimension in the flat file before moving it to the OLE DB.

-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?

i don't really know, i need your help

Usual DWH way is to have a separate load process for dimensions (eg 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). 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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