Freigeben über


Keymem Table: Key Member Definition Metadata

A key member defines a data member that is part of a multivalued key for a class. The keymem table contains metadata that defines key members for user classes. The OLE DB provider for Commerce Server 2009 uses metadata from the keymem table and other metadata to store instances of user classes in the database.

The key member metadata contains attributes for defining a data member of a key. The key member metadata includes an indication of the ordinal position of the data member for a multivalued key. The metadata for the key and the member must already be defined. A key member definition is not required if the IsPrimaryKey attribute is set to True (1) in the metadata for the class.

Three attributes are required to set a data member as part of a key:

  • The MemberName of the Key Member metadata must be set to the MemberDefName value specified in the Member metadata.

  • The KeyDefName for the Key Member metadata must be set to the ClassKeyDefName value specified in the Key metadata.

  • The OrdinalPosInKey must be set to the position in the key for the data member.

For example, if three data members make up a key, the OrdinalPosInKey will be set to 0, 1, and 2 for the first, second, and third data members, respectively. The sequence of data members is important for the composition of a unique key.

The following table describes the columns in the keymem table. There is a row in the keymem table for each key member that is defined.

Column name

Type

Allow null

Requirement

Description

KeyMemberID

int

no

Leave blank

Stores the internal identifier for the key member.

CatalogID

int

yes

Leave blank

Stores the identifier for the schema catalog.

CatalogName

nvarchar (128)

yes

Leave blank

Stores the name of the schema catalog, "DWSchema".

CreatedTime

datetime

yes

Reserved

Records when the key member was created.

Description

nvarchar (128)

yes

Optional

Stores the description of the object.

DisplayName

nvarchar (128)

yes

Optional

Stores the display name of the object.

KeyDefID

int

yes

Leave blank

Stores the identifier for the key that contains this key member.

KeyDefName

nvarchar (128)

yes

Required

Stores the name of the class key.

MajorVersion

int

yes

Reserved

Stores the major version number for the key member.

MemberID

int

yes

Leave blank

Stores the identifier for the data member used for this key member.

MemberName

nvarchar (100)

yes

Required

Stores the name of the data member used for this key member.

MinorVersion

int

yes

Reserved

Stores the minor version number for the key member.

ModifiedTime

datetime

yes

Reserved

Records when the key member was last modified.

OrdinalPosInKey

int

yes

Required

Stores a 0-based index for the position of the key member in the key.

Status

int

yes

Reserved

Reserved.

See Also

Other Resources

Data Warehouse Meta-Model