EnumReferencedTables Method (SQL-DMO)

The EnumReferencedTables method returns a QueryResults object enumerating tables on which a PRIMARY KEY or UNIQUE constraint is defined.

Applies To

Table Object

Syntax

object.EnumReferencedTables( [ IncludeAll ] ) as QueryResults

Part Description
object Expression that evaluates to an object in the Applies To list
IncludeAll True or False

Returns

A QueryResults object containing one result set defined by these columns.

Column Data type Description
candidate_table nvarchar(262) Name of the table on which the a PRIMARY KEY or UNIQUE constraint is defined.
candidate_key nvarchar(129) Not applicable. Contains the string N/A.
referenced bit When 1, the table referenced by the Table object used depends on the result-set listed table in a FOREIGN KEY relationship.

Remarks

When IncludeAll is True, the result set enumerates all tables on which PRIMARY KEY and UNIQUE constraints are defined. The value of the referenced column in the result set determines table object dependency on the table listed in the result set.

When IncludeAll is False (default), the result set enumerates only those tables containing PRIMARY KEY or UNIQUE constraints and on which the referenced table depends.

Prototype (C/C++)

HRESULT EnumReferencedTables(
LPSQLDMOQUERYRESULTS* ppResults,
BOOL IncludeAllCandidates = NULL);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.