Skip to content

config.edwTableJoins

Shruti Goyal edited this page Apr 25, 2025 · 2 revisions
Field Details
Description It defines the join relationships between base and related tables in the data warehouse, using foreign key references from the [config].[edwTables] table. It specifies join type, custom join SQL, and join order to control data transformations in ETL processes.
Schema config
Object Type Table
Primary Key TableID & RelatedTableID

Table Definition

Column Description Example
TableID Foreign Key to [config].[edwTables]. Refers to the base (main) table for which joins are being defined. 7
RelatedTableID Foreign Key to [config].[edwTables]. Refers to the related (joined) table. 1
ShowBK Optional flag to indicate whether to expose Business Keys from the joined table in the final output. 1 | 0
JoinSQL Optional custom SQL for the join condition between the tables. Overrides default PK/FK joins if provided. A.ID = B.ID
AliasPK Optional alias used for the primary key of the joined table in the SQL transformation. B_ID
JoinOrder Numeric value to define the order in which joins are applied (lower numbers are joined first). 1, 2, 3
JoinType SQL join type used in the join logic (e.g., INNER, LEFT, RIGHT). LEFT

Foreign Keys

Foreign Table Foreign Key Column
config.edwTables TableID
config.edwTables RelatedTableID

Sample T-SQL to Add New Table Joins

INSERT INTO [config].[edwTableJoins]
      ([TableID]
      ,[RelatedTableID]
      ,[ShowBK]
      ,[JoinSQL]
      ,[AliasPK]
      ,[JoinOrder]
      ,[JoinType])
VALUES(7, 1, NULL, NULL, NULL, NULL, NULL);

Clone this wiki locally