AlHal2
asked on
track foreign key constraints through database hierarchy
A relational database may have table B having a foreign key constraint against table A and table C having a foreign key constraint against table A.
If I want to delete data from table A I must delete from table C then table B then table A.
Is there a way of finding all the tables dependant on a certain table within the hierarchy. I was thinking of a recursive CTE using system tables, but am open to any suggestions.
Any solution would need to work with SQL 2005.
If I want to delete data from table A I must delete from table C then table B then table A.
Is there a way of finding all the tables dependant on a certain table within the hierarchy. I was thinking of a recursive CTE using system tables, but am open to any suggestions.
Any solution would need to work with SQL 2005.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER