I recently had an issue with trying to expand the lookup & user columns in a SharePoint 2013 OnPrem list which I`m importing into a SQL Server 2012 database.
I had thought that an OData query would be the answer and whilst I can achieve it via a URL in my browser it doesn`t seem to be accepted by the OData adapter in SSIS.
For example the simple URL below returns the Item ID, Name and Email Address of the last person to modify the item:
<a href="https:///_vti_bin/listdata.svc/<LISTNAME>?$select=Id,ModifiedBy/Name,ModifiedBy/WorkEmail&$expand=ModifiedBy">https://<URL>/_vti_bin/listdata.svc/<LISTNAME>?$select=Id,ModifiedBy/Name,ModifiedBy/WorkEmail&$expand=ModifiedBy
It works fine in the browser but when I use the same in the OData adapter I get the error below. I did try the _api URL but that doesn`t supply a ATOM Service Document so is classed as an invalid feed by the OData adapter.
Can anyone assist?
An error occured when reading the OData feed. (Microsoft.SqlServer.IntegrationServices.DataFeedClient)
------------------------------
Program Location:
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedODataReader.InterceptODataException[T](Func`1 function)
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedODataReader.ReadNextODataEntry()
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.BufferedRowsReader.FetchNextRow(IRow reuseRow)
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.BufferedRowsReader.MoveNext()
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedDataReader.Read()
at Microsoft.DataTransformationServices.DataFlowUI.ODataConnectionPage.PreviewButton_Click(Object sender, EventArgs e)
===================================
An error was read from the payload. See the 'Error' property for more details. (Microsoft.Data.OData)
------------------------------
Program Location:
at Microsoft.Data.OData.Atom.BufferingXmlReader.ReadNextAndCheckForInStreamError()
at Microsoft.Data.OData.Atom.BufferingXmlReader.ReadInternal(Boolean ignoreInStreamErrors)
at Microsoft.Data.OData.Atom.BufferingXmlReader.Read()
at System.Xml.XmlReader.SkipSubtree()
at System.Xml.XmlReader.Skip()
at Microsoft.Data.OData.Atom.ODataAtomEntryAndFeedDeserializer.ReadFeedContent(IODataAtomReaderFeedState feedState, Boolean isExpandedLinkContent)
at Microsoft.Data.OData.Atom.ODataAtomReader.ReadAtEntryEndImplementation()
at Microsoft.Data.OData.ODataReaderCore.ReadImplementation()
at Microsoft.Data.OData.ODataReaderCore.ReadSynchronously()
at Microsoft.Data.OData.ODataReaderCore.InterceptException[T](Func`1 action)
at Microsoft.Data.OData.ODataReaderCore.Read()
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedODataReader.ReadNextODataEntryInternal()
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedODataReader.<ReadNextODataEntry>b__6()
at Microsoft.SqlServer.IntegrationServices.DataFeedClient.DataFeedODataReader.InterceptODataException[T](Func`1 function)