|
frank.svs
Constraint Violating Yak Guru
368 Posts |
Posted - 04/11/2010 : 04:19:42
|
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
|
|