Solved

track foreign key constraints through database hierarchy

Posted on 2013-01-25
3
386 Views
Last Modified: 2013-01-31
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.
0
Comment
Question by:AlHal2
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
esolve earned 250 total points
ID: 38818297
0
 

Author Comment

by:AlHal2
ID: 38818322
thanks.
0
 

Author Closing Comment

by:AlHal2
ID: 38838842
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question