Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

The given key was not present in the dictionary. SSIS XML SOURCE Expand / Collapse
Posted Tuesday, April 22, 2014 12:02 PM


Group: General Forum Members
Last Login: Tuesday, January 20, 2015 4:08 AM
Points: 16, Visits: 123
Hi folks

Just looking for suggestions really.

I've got to load multiple XML files into a database. I've managed (finally) to reduce the XML file to the elements I'm interested in using an XSLT task. I can load the first XML file fine. But when I tried a second, it turned up the above error.

I originally generated the XSD file from the first XML file (although I have amended it). However, I've visited several sites, XMLFormatter etc and validated the generated XSD against the second XML file. All 3 report valid structure and content, and yet, when I run the SSIS package it fails.

The exact error message is

[XML Source [1]] Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.SqlServer.Dts.Pipeline.DtsDataTableCollection.AssociateTablesWithBuffers(IDTSOutputCollection100 outputs, IDTSBufferManager100 bufferManager, Int32 localeID, DataSet dataSet)
at Microsoft.SqlServer.Dts.Pipeline.DtsDataTableCollection..ctor(XmlSourceAdapter xmlSourceAdapter, IDTSOutputCollection100 outputs, Int32 localeID, DataSet dataSet, IDTSBufferManager100 bufferManager)
at Microsoft.SqlServer.Dts.Pipeline.XmlSourceAdapter.Validate()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostValidate(IDTSManagedComponentWrapper100 wrapper)

I'm finding it difficult to identify what to look at. Is this an XML error or a SSIS error? Any suggestions for how to proceed would be VERY gratefully received. How do I identify the key in question?


Post #1563983
Posted Thursday, April 24, 2014 4:50 PM


Group: General Forum Members
Last Login: Today @ 1:59 PM
Points: 6,573, Visits: 17,293
Could you post the xsd and some sample xml, hard to tell what is happening without more info.
Post #1564922
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse