Key Definition Meta-data

The Key meta-data contains attributes for defining a key for a class. A key defines the unique identification for a class. Use the Key meta-data to manually specify a single key or to create a multi-part key.

In order to create a key, the Class definition must already be created. The ClassDefName attribute creates the actual link to the encompassing class; thus the class name in the ClassDefName attribute must match the ClassDefName attribute for the wanted class.

Instead of using the Key and Key Member meta-data, a single key may be set through the IsPrimaryKey attribute of the Member meta-data. Multi-valued keys must always be defined using the Key and Key Member meta-data.

For information about creating a new class key, see Creating a New Class Key.

The following table shows the attributes used for the class key definitions. A set of these attributes is stored in the ClsKeyDef table for each class key defined.

Attribute Data Type Constraint Requirement Description
ClassKeyDefID int NOT NULL Leave blank Stores the unique identifier for the key.
CatalogID int NULL Leave blank Stores the identifier for the Commerce Server 2000 schema catalog.
CatalogName nvarchar (128) NULL Leave blank Stores the name of the schema catalog. For this release of Commerce Server, the catalog name is "DWSchema."
ClassDefName nvarchar (128) NULL Required Stores the name of the class associated with the key.
ClassID int NULL Leave blank Stores the identifier of the class associated with the key.
ClassKeyDefName nvarchar (128) NULL Required Stores the name of the class key.
CreatedTime datetime NULL Leave blank Records when the key was created.
Description nvarchar (128) NULL Optional Stores the description for the key potentially displayed on the UI.
DisplayName nvarchar (128) NULL Optional Stores the name potentially displayed on the UI for the key.
IsPrimaryKey tinyint NULL Optional Indicates if this is the primary key. Defaults to False (0).
MajorVersion int NULL Optional Stores the major version number for the key.
MinorVersion int NULL Optional Stores the minor version number for the key.
ModifiedTime datetime NULL Leave blank Records when the key was last modified.
Status int NULL Leave blank Reserved.


All rights reserved.