2

We are having list wherein, we where pushing records from mobile app to the SharePoint List. We were just adding mobile device id into the list for push notification. In 2 year time records reach to more than 1 million. We never used that list, now suddenly we need to retrieve those records of the list.

I know that once threshold reach, it is difficult to retrieve the records. So what I was looking that is there any way that we extract those data to some excel or some other database, this is for once only.

Do somebody have any idea for it.

1
  • 1
    Have you tried PowerShell to access the list and export entries to csv-format which you can read using Excel? Also remember that Excel has a row limit of 1,048,576 which is very close to your million entries...
    – Benny Skogberg
    Commented Aug 16, 2016 at 6:37

1 Answer 1

2

With large lists you should use Content Iterator and you can read info about designing large lists. Example of usage:

private void GetItems()
{
    SPList list = SPContext.Current.Web.Lists["My list"];

    SPQuery query = new SPQuery();
    query.Query = "<Where></Where>";
    query.ViewFields = "<FieldRef Name='Field1'/>";
    query.ViewFields = "<FieldRef Name='Field2'/>";

    ContentIterator iterator = new ContentIterator();
    iterator.ProcessListItems(list,
        query,
        ProcessItem,
        ProcessError
    );
}

public bool ProcessError(SPListItem item, Exception e)
{
    //process error
}

public void ProcessItem(SPListItem item)
{
    //process SPListItem
}

Also, you can use batch commands for adding, updating or deleting items.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.