Search This Blog

Saturday 22 June 2013

Using RecordInsertedList To Insert Multiple Records In Single Database Transaction

RecordInsertList Class:

The RecordInsertList class provides array insert capabilities in the kernel.   

RecordInsertList Class is really very helpfull class to increase the perfomance  while inserting  the bulk records.

Like there is a scenario where you are inserting the bulk records into the table using the while select one by one.In this case if there is a scenario where you are trying to enter the 100 records one by one than its means that you are trying to hit the database 100 times.

Now by the help of the RecordInsertList Class.We can easily insert these 100 records in single database trip.

Below is the example of how can we use the RecordInsertListClass:


As you can see in the above image that I have Declare the RecordInsertList object and than I have assign the values to the table buffer and than I am going to add the table buffer to the RecordInsertList object and one all buffers are added to the list I am going to insert them into the database.

This was all from my side ralated to the RecordInsertList.I hope you like that.

Below is the link of msdn for more detail explanation about that:

RecordInsertList

Optimizing Record Inserts

Thanks

Muhammad Zahid