Connecting to SharePoint Lists with SSIS

SharePoint lists are popular and simple tools for storing modestly-sized discrete sets of data. SQL Server Integration Services (SSIS) includes a source component to allow reading data from SharePoint lists.

In this post, I’ll demonstrate how to use SSIS to read from a SharePoint list using the OData source.

SharePoint lists

A SharePoint list is a simple collection of related data items. These lists are easy to create and share with a team, and can aid in centralizing what would otherwise be reference data stored in various spreadsheets. Lists are found in both on-premises and cloud versions of SharePoint.

SharePoint lists serve both business and technical users alike. For business users, a SharePoint list is an easy way to create and maintain a visible copy of shared data. Since load processes can easily consume the (mostly) structured data in these lists, technical folks welcome them as well.

Connecting to SharePoint Lists with SSIS

When a SharePoint list is curated to the point that it is trustworthy as a source of data, it can be integrated into ETL processes using SSIS. Using the OData source in the SSIS data flow, you can easily retrieve data from a SharePoint list into your data pipeline.

As shown below, the OData source is one of the native sources in the SSIS data flow.

Sharepoint List - OData Source

You can add this to your data flow workspace and open it to display the configuration properties, as shown below.

OData Source Editor

The highlighted item above is the OData connection manager, which is the connection to the instance of SharePoint from which we’ll be retrieving the list data. Clicking New here will open the OData Connection Manager Editor shown below.

Connecting to SharePoint Lists with SSIS

As shown, appending the /_vti_bin/listdata.svc/ suffix to the SharePoint URL (or the site name, if your SharePoint setup has multiple sites) will invoke the web service to get the catalog of assets. Below there, you’ll specify the authentication method. Because this example is using SharePoint online, I’m using Microsoft Online Services to connect. (Note: If you are using Sharepoint Online, see the to-do install at the end of this post.)

Using the OData Source in the Data Flow

After testing the connectivity, click OK to return to the OData Source Editor window. the Collection dropdown list now shows the SharePoint items available. For this example I want the list ScrantonPeople.

After choosing this list, I’ll click Preview to show the data available in that feed. I’ve cut out a few of the columns for brevity. It’s important to note that the column metadata will differ depending on the options chosen for each field in the list.

Sharepoint List SSIS

With that, the OData source is ready to use! Use it as a source for loading a database table, as a lookup reference data set, or as part of business rules.

SSIS Sharepoint List

Error: “Could not load file or assembly ‘Microsoft.Sharepoint.Client.Runtime’

When using the OData source for an instance of SharePoint online, I encountered an error similar to the following:

Could not load file or assembly Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0

Could not load file or assembly ‘Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies. The system cannot find the file specified.

I discovered this error on recent versions of SSIS, using both Visual Studio 2017 (SSDT) and Visual Studio 2019. As it turns out, the online version of SharePoint requires a specific version of the assembly Microsoft.SharePoint.Client.Runtime. This runtime requires a separate download and install. As of this writing, the required version is 15.0 (the same version associated with SharePoint 2013), which can be downloaded here.

 

 

About the Author

Tim Mitchell
Tim Mitchell is a data architect and consultant who specializes in getting rid of data pain points. Need help with data warehousing, ETL, reporting, or training? If so, contact Tim for a no-obligation 30-minute chat.

1 Comment on "Connecting to SharePoint Lists with SSIS"

  1. Dear Mr. Mitchell,

    Thank you for such a nice elobarated blog post. when I was following your post I got an prompt for missing sharepoint client components sdk ( online sharepoint ) which I installed. eventhough I installed it I am getting the same prompt ? Coud you be kind to help me out in this error ?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.