April 6, 2009 at 1:10 pm
Looking for T-SQLto list my tables in a single database in hierarchical fashion.. with all PARENT tables 1st, followed by all dependants, then all descendants, etc..
eg.
Corporation_Table
Branch_Table
Division_Table
Department_Table
Employee_Table
thx in advance
April 6, 2009 at 3:26 pm
Hi,
if you know one parent table you can get all dependencies with the attached script (captured from sql server profiler). (the parent table is in line 15)
Maybe it helps as a starting point.
-----------------------
SQL Server Database Copy Tool at Codeplex
April 7, 2009 at 1:28 am
DBASkippack (4/6/2009)
Looking for T-SQLto list my tables in a single database in hierarchical fashion.. with all PARENT tables 1st, followed by all dependants, then all descendants, etc..eg.
Corporation_Table
Branch_Table
Division_Table
Department_Table
Employee_Table
thx in advance
Probably a silly question but have to make sure... Do you have DRI setup across all of these table that identifies the parent/child relationships?
--Jeff Moden
April 7, 2009 at 4:26 am
Thanks for the quick feedback folks. and Yes, we have DRI implemented. (and for those tables without DRI, that's fine) --
I'm just trying to identify the LOAD SEQUENCE for 100+ tables in my SSIS package.. My HARNESS package will fire sub-LOADERS which each contain individual SSIS pkg's ... Need to load those PARENTS 1st of course..
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply