ADMIN_GetRelatedTables

 Show all Hide all

Deprecated.

Recursively looks up tables with foreign keys pointing to the specified tables.

Type: Table-valued function
Area of use: General use

Parameters:

@TableString mandatory nvarchar
Comma separated list of table names
@MaxRecursion optional int
Number of recursion levels. 0 indicates that only the directly related tables are listed. The default value for this paramter is 100.

Resultsets:

Resultset: Related tables

Repeat mode: repeated exactly once
Row count: zero or more rows

Columns:

chain mandatory string
Used for recursion to deduce the path followed to this relation
column_name mandatory sysname
Name of the referring column
datatype mandatory string
Data type of the column
foreign_column_name mandatory sysname
Name of the referred column
foreign_table_id mandatory int
Id of the referred table
foreign_table_name mandatory sysname
Name of the referred table
foreign_table_owner mandatory sysname
Owner of the referred table
ordinal mandatory int
Identifier for the relation
table_id mandatory int
Id of the referring table
table_name mandatory sysname
Name of the referring table
table_owner mandatory sysname
Owner of the referring table