April 11, 2010 at 2:19 am
Hi,
Do we have any algorithm or procedure or a user defined function to which i can pass the tables names and it should tell me the loading sequence.
For example i have 3 tables say A,B,C where A and B are master tables and C is a transactional table which references A(c1) and b(id).
If i pass the tablenames to the stored procedure/functions, it is should suggest me the loading sequence.
declare @tableList varchar(100);
set @tableList = '''C'',''A'',''B''';
exec sp_showLoadingSequence(@tableList)
--Expected output
A,B,C
If anyone has tried this before????????
I can go for Database diagram but if we are having large set to tables to be loaded then it is becoming great confusion. so, i thought if we can find out a way from T-SQL then it will be good.
Any thoughts will be greatly appreciated!
Thanks in Advance
April 11, 2010 at 11:46 am
I searched for scripts on this site using the keywords "script table relationship" and found the following link that might get you started:
April 11, 2010 at 12:31 pm
Thanks
April 11, 2010 at 12:47 pm
Hey Lutz,
The script you mentioned is for different purpose. It is similar to sp_help /to know the structure of a table!!!! 😉
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply