Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: 1128 | Views in the last 30 days: 9
 
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

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones