次の方法で共有


EnumReferencingKeys Method

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。 新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。

The EnumReferencingKeys method returns a QueryResults object that enumerates the FOREIGN KEY constraints depending on a candidate key defined on the referenced table.

構文

object.EnumReferencingKeys( [ ReferencingTable ] , [ IncludeAll ] )as QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • ReferencingTable
    Optional. String that names an existing Microsoft SQL Server table. Restricts result set membership to list only FOREIGN KEY constraints defined on the specified table.

  • IncludeAll
    TRUE or FALSE.

Prototype (C/C++)

HRESULT EnumReferencingKeys(
LPSQLDMOQUERYRESULTS* ppResults,
SQLDMO_LPCSTR ReferencingTableName = NULL,
BOOL IncludeAllCandidates = NULL);

Returns

A QueryResults object that contains one result set defined by these columns.

Column

Data type

Description

candidate_key

nvarchar(129)

Name of the FOREIGN KEY constraint depending on a candidate key in the referenced table.

candidate_table

nvarchar(262)

Name of a table on which a FOREIGN KEY constraint is defined.

referenced

bit

When 1, the FOREIGN KEY constraint listed in the result set depends on the table referenced by the Table object used.

説明

When IncludeAll is TRUE, the result set enumerates all user-defined tables in the database. The candidate_key column is NULL for those tables on which a FOREIGN KEY constraint is not defined. The value of the referenced column in the result set determines FOREIGN KEY constraint dependency.

When IncludeAll is FALSE (default), the result set enumerates only those FOREIGN KEY constraints depending on the referenced table.

Applies To: