![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello DataMan, I am one for having a PK in the fact table. The PK enforces the grain (lowest level) of your fact table. This stops the loading of duplicates into your fact table. The PK is also used to in force the referential integrity of the data relationships between the fact table and the dimensions. Its all about trusting the data is correct in your fact table. A good mark of a star schema is to have referential integrity enforced. This guarantees that every fact record has a corresponding dimension record. Of course you will have to handle unknown dimension keys this where the fact table has a record that does not exist in the dimension. I usually create a dimension record as unknown and allocate it to fact table surrogate key for that dimension. Most OLAP engines check this as a test before building the OLAP cube. In the case of Microsoft Analysis Services an error will be raised if a fact record has a dimension key that does not exist in the dimension. I hope this helps, Myles Matheson Data Warehouse Architect http://bi-on-sql-server.blogspot.com/ Thanks for the feedback. I've not actually ever been able |
![]() |
| Thread Tools | |
| Display Modes | |
| |