This documentation is archived and is not being maintained.

PropertyRef Element (SSDL)

The PropertyRef element in store schema definition language (SSDL) references a property defined on an EntityType element to indicate that the property will perform one of the following roles:

  • Be part of the primary key of the table that the EntityType represents. One or more PropertyRef elements can be used to define a primary key. For more information, see Key element.

  • Be the dependent or principal end of a referential constraint. For more information, see ReferentialConstraint element.

The PropertyRef element can only have the following child elements:

Applicable Attributes

The table below describes the attributes that can be applied to the PropertyRef element.

Attribute Name Is Required Value



The name of the referenced property.

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


The following example shows a PropertyRef element used to define a primary key by referencing a property that is defined on an EntityType element.

<EntityType Name="Customers">
    <Summary>Summary here.</Summary>
    <LongDescription>Long description here.</LongDescription>
    <PropertyRef Name="CustomerId" />
  <Property Name="CustomerId" Type="int" Nullable="false" />
  <Property Name="Name" Type="nvarchar(max)" Nullable="false" />

See Also