Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Get all the Child Tables up to N level

By Thava,

Get all the dependent tables for a master table  up to N level(Till the leaf ) you can either find dependency or you can find all the child tables.
To find the  Complete Relation
SELECT TableRelation
FROM   cte
Order by TableRelation
or 
To find only the Dependent Table only
SELECT DISTINCT DependentTable
FROM   cte

Total article views: 2574 | Views in the last 30 days: 48
 
Related Articles
FORUM

Questions about Dependencies

Questions about Dependencies

ARTICLE

It Depends

It depends. The mantra of many DBAs and others in IT. Steve Jones reminds us why it applies.

BLOG

Find Dependencies

Here's a script from my toolbox I use to find dependencies between SQL objects.  The where clause ha...

SCRIPT

Dependencies View 2008

Provides a list of dependencies for a stored procedure

ARTICLE

Data Profiling Column Functional Dependency T-SQL

This article demonstrates Data Profiling Functional Dependency

Tags
 
Contribute