This documentation is archived and is not being maintained.

Association Element (SSDL)

An Association element in store schema definition language (SSDL) specifies table columns that participate in a foreign key constraint in the underlying database. Two required child End elements specify tables at the ends of the association and the multiplicity at each end. An optional ReferentialConstraint element specifies the principal and dependent ends of the association as well as the participating columns. If no ReferentialConstraint element is present, an AssociationSetMapping element must be used to specify the column mappings for the association.

The Association element can have the following child elements (in the order listed):

Applicable Attributes

The following table describes the attributes that can be applied to the Association element.

Attribute Name Is Required Value



The name of the corresponding foreign key constraint in the underlying database.

Any number of annotation attributes (custom XML attributes) may be applied to the Association element. However, custom attributes may not belong to any XML namespace that is reserved for SSDL. The fully-qualified names for any two custom attributes cannot be the same.


The following example shows an Association element that uses a ReferentialConstraint element to specify the columns that participate in the FK_CustomerOrders foreign key constraint:

<Association Name="FK_CustomerOrders">
  <End Role="Customers" 
       Type="ExampleModel.Store.Customers" Multiplicity="1">
    <OnDelete Action="Cascade" />
  <End Role="Orders" 
       Type="ExampleModel.Store.Orders" Multiplicity="*" />
    <Principal Role="Customers">
      <PropertyRef Name="CustomerId" />
    <Dependent Role="Orders">
      <PropertyRef Name="CustomerId" />

See Also