Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch Insert using trigger

Status
Not open for further replies.

anithamg

Programmer
Nov 21, 2002
6
0
0
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top