sp_fkeys

Description

Returns primary and foreign key information for the specified table or tables. Foreign keys must be declared through the ANSI integrity constraint mechanism.

Syntax

sp_fkeys pktable_name [, pktable_owner]
 [, pktable_qualifier] [, fktable_name] 
 [, fktable_owner] [, fktable_qualifier]

Parameters

pktable_name

is the name of the table containing the primary key. Wildcard-character search patterns are not supported. You must specify this parameter, the fktable_name parameter, or both.

pktable_owner

is the owner of the table containing the primary key. Wildcard-character search patterns are not supported.

pktable_qualifier

is ignored. Leave blank or set to NULL.

fktable_name

is the name of the table containing the foreign key. Wildcard-character search patterns are not supported. You must specify this parameter, the pktable_name parameter, or both.

fktable_owner

is the owner of the table containing the foreign key. Wildcard-character search patterns are not supported.

fktable_qualifier

is ignored. Leave blank or set to NULL.

Usage

This procedure corresponds to the ODBC function SQLForeignKeys.