PRIMARY_KEYS Rowset

GUID: DBSCHEMA_PRIMARY_KEYS

Number of restriction columns: 3

Restriction columns: TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME

Default sort order: TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME

Description: The PRIMARY_KEYS rowset identifies the primary key columns defined in the catalog by a given user. This schema rowset is built upon an SQL-92 schema view as a convenience to the non-SQL programmer and, if supported, must be synchronized with the related SQL-92 view (CONSTRAINT_COLUMN_USAGE).

Column name

Type indicator

Description

TABLE_CATALOG

DBTYPE_WSTR

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

TABLE_SCHEMA

DBTYPE_WSTR

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

TABLE_NAME

DBTYPE_WSTR

Table name.

COLUMN_NAME

DBTYPE_WSTR

Primary key column name. 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

Primary key column GUID.

COLUMN_PROPID

DBTYPE_UI4

Primary key column property ID.

ORDINAL

DBTYPE_UI4

The order of the column names (and GUIDs and property IDs) in the key.

PK_NAME

DBTYPE_WSTR

Primary key name. NULL if the provider does not support primary key constraints. This column is not returned by 1.x providers.