Re: Deleting records with referential integrity
Posted in 1996
Robert,
Here is a "quick and dirty" way of finding out which tables have a
referential constraint tied to your main table.
select tabname from systables where tabid in (select tabid fromsysconstraints where constrid in (select constrid from sysreferences
where ptabid= (select tabid from systables where tabname='name')))
It doesn't look pretty but it does work.
--
Joseph Cullipher |E-mail: joseph@cannonexpress.com
PO Box 364 |opinions express are those of my own and
Springdale, AR 72764 USA |don't necessarily reflect those of my company
On 13 Nov 1996, Robert Arciere wrote:
> I am trying write a "quick and dirty" program that will delete all
> occurances in all tables with a certain Primary/Foreign Key.
>
> Is there and existing utility that will do this.
>
> How can I find out all of the tables which contain a referential contraint
> to this key, so I can delete entries in the proper order.
>
> Any advice would be appreciated
>