We are transferring huge amount of data btn SQL Server.
Let's say there are 3 destination tables
1. Tabe A [Master Table]
ID Name
2. B
ID1 Name
3. C
ID2 Name
All the ID's aren't autonumbers. That means I need to take max(ID)+1 and insert into them. For each 'A' record there are 10 B record and for each B there are another 10 record. I cannot transfer them doing bulk insert. Right now i've written Cursors to generate ID for A, insert and then generate ID's for B, insert and Same for C.
It's taking so long to transfer the data. Is there any other optimized way of doing it?
Let's say there are 3 destination tables
1. Tabe A [Master Table]
ID Name
2. B
ID1 Name
3. C
ID2 Name
All the ID's aren't autonumbers. That means I need to take max(ID)+1 and insert into them. For each 'A' record there are 10 B record and for each B there are another 10 record. I cannot transfer them doing bulk insert. Right now i've written Cursors to generate ID for A, insert and then generate ID's for B, insert and Same for C.
It's taking so long to transfer the data. Is there any other optimized way of doing it?