Forum Post: RE: Content Upload

  • Thread starter Thread starter TheMadDBA
  • Start date Start date
Status
Not open for further replies.
T

TheMadDBA

Guest
2 will be faster than 1 because it will not create a huge temp-table. You can combine the two approaches and make it easier on the database and your code. Create/Import the temp-table records... increment a counter while you do it. If you get to 100 records then run through the entire temp-table and create your DB records in one transaction. Then empty the temp-table either as you go along or after the transaction. Just make sure to run the same temp-table to DB update after the input stream close to catch any remaining records. Best to just put the temp-table DB update logic in a procedure/function and call it from inside/outside the loop.

Continue reading...
 
Status
Not open for further replies.
Back
Top