Foreign Key

Top Previous Topic Next Topic  Print this topic

<das:foreign-key> describes a foreign key constraint from the current table to its parents.

 

In the context of relational databases, a foreign key is a referential constraint between two tables. The foreign key identifies a column or a set of columns in one (referencing) table that refers to a set of columns in another (referenced) table. The columns in the referencing table must be the primary key or other candidate key in the referenced table. The values in one row of the referencing columns must occur in a single row in the referenced table. Thus, a row in the referencing table cannot contain values that don't exist in the referenced table (except potentially NULL). This way references can be made to link information together and it is an essential part of database normalization. Multiple rows in the referencing table may refer to the same row in the referenced table. Most of the time, it reflects the one (master table, or referenced table) to many (child table, or referencing table) relationship.

 

Attributes:

 

id - unique identifier of this resource in the current processing job.

parent-key - the name of the field in the referenced table.

key - the name of the field in the referencing table.

parent-id - the referenced data source id. Must be a table data source.

 

Note. A comprehensive sample using foreign-keys can be found at Samples\Job Samples\ForeignKeySample.dax .

 

 

<das:foreign-key id="fkey" parent-key="ID" key="EMP_ID" parent-id="ds1"/>