Thursday, July 30, 2015

Batch operation on SharePoint List through code

Are are you dealing with huge data for CRUD operation on SharePoint list through code, then you have to skip the conventional SSO code to calling the list and list item collecton.

Looping the each item in the Item collection is querying the database.

So if there is 50000 items to be inserted on your SharePoint list, your code will call the DB query 50000 times. Its process intense and overhead on SQL server.

In such scenario consider to use the ProcessBatchUpdate method of SPWeb class and also ContentIterator API.