BG_Entity_ForeignKey_Identity
Applies to
Platform: Microsoft SQL Server · Snowflake · Databricks · Fabric Lakehouse · Fabric Warehouse
Architecture: Dimensional
BG_Entity_ForeignKey_Identity is the reference from an Entity to another Entity: the surrogate key of the related row. The loader looks it up from the business key of the relationship.
Objects that carry it
Entity, once for each relationship to another Entity. Its name has the form <referenced model object>_<role>_SK.
Value
The Lookup view of the Entity joins the related Entity on the foreign-key terms of the relationship and takes its BG_Entity_Identity. When the related Entity is historized and the Entity has a mapped BG_EffectiveTimestamp, the lookup selects the version that is valid at that timestamp. A business key without a match gets -1, the key of the unknown-member row.
Data type
- Microsoft SQL Server, Fabric Warehouse:
int - Snowflake:
INTEGER - Databricks, Fabric Lakehouse:
long
Example
An Entity on Microsoft SQL Server has a relationship to the Entity common_loyaltycard_scd1, so it gets the term common_loyaltycard_scd1_common_loyaltycard_scd1_SK. Loyalty card 500 exists with the surrogate key 1, card 999 does not exist:
TRANSACTION_ID LOYALTYCARD_ID common_loyaltycard_scd1_..._SK 1 500 1 4 999 -1
Related articles
- Reference: BG_Entity_Identity, BG_Fact_ForeignKey_Identity, BG_EffectiveTimestamp
- See also: Create an Entity