I have a routine in an n-tier app that when runs, creates about 150,000 new records to insert into a table. Currently, it's inserting the record one-by-one and it's slow. Can anyone give some specific code sample to batch update all the records?
I'm weak in ADO anyway but I though maybe I can create a new recordset in the Business-tier, use AddNew to add new records from properties in my collection object and call UpdateBatch and somehow, magically it would be done but...
Something like this with LGOS being a collection of LG object
Set rsLGO = New Recordset
With rsLGO
.CursorLocation = adUseClient
.LockType = adLockBatchOptimistic
.CursorType = adOpenKeyset
End With
For Each LGO in LGOS
LGO.EstimatedQty = GetEstimatedTotalCount(LGO)
rsLGO.AddNew
CopyListGridOrderObjToListGridOrderRs LGO, rsLGO
Next
rsLGO.UpdateBatch
It's "my" world. You're just living in it.