getting Child Tables List for a Given Table using SMO

  • Hello All,

    Can any one tell me  how to get the list of child tables for a given table. I am able to backtrack it. ie, given a table i am able to retrieve all its parent tables.. can anybody throw light on this..

    Thanks Much!!

    -Raj.


    Regards,

    Raaja

  • Open a new query window switch to the DB in question and run: select * from sys.sysdepends

    The ID and DEPID columns use them to find the objects using query below (replace id with your ids)

    select * from sys.sysobjects where id in( 69575286,21575115)

    You can find the logic from here to build your tree.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply