When I do a select on a record, is there a way that I can tell if it is
being referenced by another table, and if so, can I tell by what table?
↪ replying to mpw
On Tue, 08 Jul 2003 17:56:08 -0400, mpw wrote:
> When I do a select on a record, is there a way that I can tell if it is
> being referenced by another table, and if so, can I tell by what table?
The system catalog table, sysreferences, will tell you if the TABLE is
referenced in foreign key constraints by any other tables and by
following the chain of constraint ids you can determine which table(s)
is/are referencing this one. Once you've done that you can query the
referencing table to determine if there are actually any records that
refer the a particular record's key (the foreign key constraint
definition will tell you the name of the referencing field(s) in the
other table).
Art S. Kagel