July 8, 2005 at 6:22 am
wats the best way to copy heirarchical data in stored proc , for example there are 3 tables parent, child, grandchildren . so wat we need to do is copy first row from parent and all the child rows for that row and further rows in grandchildren .
we will be using vb.net and ado.net ,so thought of following options
any other suggestions?
wat will be best solution from perfomance point of view ???
thnx
amrita
July 8, 2005 at 6:28 am
Can you post the table definition, some sample data and the expected results?
July 8, 2005 at 8:00 am
sure lets say there are 3 tables (actually table will be decided at the runtime , nyways)
country , state , city in the source , they can be in different database servers and three tables in destination also , so wat we need to do is
first copy first country (India )
now copy all the states for the country india
now copy all the cities which are child of above states
reason being no orphaned child id copied
hope that clarify
thnx
amrita
July 8, 2005 at 8:03 am
Not really. The fact that this will be dynamic makes generating this code a big pain. Can't this be static?
Can you provide the actual table script, Sample data and expected output from the queries?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply