PRIMARY_KEYS Rowset

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

The PRIMARY_KEYS rowset contains the following columns.

Column name Type indicator Description
PK_NAME DB_WSTR Primary key name. NULL if the provider does not support primary key constraints. This column is not returned by 1.x providers.
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.

Default Sort Order: TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME