Partager via


KEY_COLUMN_USAGE Rowset

GUID: DBSCHEMA_KEY_COLUMN_USAGE

Number of restriction columns: 7

Restriction columns: CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME

Default sort order: CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION

Description: The KEY_COLUMN_USAGE rowset identifies the columns defined in the catalog that are constrained as keys by a given user.

Column name

Type indicator

Description

CONSTRAINT_CATALOG

DBTYPE_WSTR

Catalog name. NULL if the provider does not support catalogs.

CONSTRAINT_SCHEMA

DBTYPE_WSTR

Unqualified schema name. NULL if the provider does not support schemas.

CONSTRAINT_NAME

DBTYPE_WSTR

Constraint name.

TABLE_CATALOG

DBTYPE_WSTR

Catalog name in which the table containing the key column is defined. NULL if the provider does not support catalogs.

TABLE_SCHEMA

DBTYPE_WSTR

Unqualified schema name in which the table containing the key column is defined. NULL if the provider does not support schemas.

TABLE_NAME

DBTYPE_WSTR

Table name containing the key column.

COLUMN_NAME

DBTYPE_WSTR

Name of the column participating in the unique, primary, or foreign key. This column, together with the COLUMN_GUID and COLUMN_PROPID columns, forms the column ID. One or more of these columns will be NULL, depending on which elements of the DBID structure the provider uses.

COLUMN_GUID

DBTYPE_GUID

Column GUID.

COLUMN_PROPID

DBTYPE_UI4

Column property ID.

ORDINAL_POSITION

DBTYPE_UI4

Ordinal position of the column in the constraint being described. If the constraint being described is a key of cardinality one, the value of ORDINAL_POSITION is always one.