XML Source

时间:2018-04-27 14:15:34

标签: xml ssis-2012

我正在尝试将数据从XML文件加载到SQL Server表中使用SSIS包, 但它在数据流中执行它和XML源时不断给我这个错误。

如果我在具有相同XML文件的不同PC中执行它,我会收到任何错误消息,但我使用的是公司PC。

Error Message,
**Error 1**"The XML Source was unable to process the XML data. Object 
reference not set to an instance of an object."
**Error 2:**[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  
The PrimeOutput method on XML Source returned error code 0xC02092AF.  The 
component returned a failure code when the pipeline engine called 
PrimeOutput(). The meaning of the failure code is defined by the component, 
but the error is fatal and the pipeline stopped executing.  There may be 
error messages posted before this with more information about the failure.

This是使用的XML文件:

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您的xmlsource文件不包含有效的xml,这就是发生此错误的原因。 使用下面的xml数据。

  <?xml version="1.0" encoding="UTF-8"?>
    <counters>
      <counter>
         <extractDate>2007-12-O5</extractDate>
         <category>dispatcher</category>
         <name>server1</name>
         <runtime>6</runtime>
         <queue>3</queue>
         <maxrequest>8</maxrequest>
         <color>blue</color>
         <hostName>svo2555</hostName>
         <path>\\dispatcher</path>
         <lastaccessed>2007-O2-03</lastaccessed>
     </counter>
     <counter>
         <extractDate>2007-12-O5</extractDate>
         <category>gateway</category>
         <name>server1</name>
         <runtime>1</runtime>
         <queue>10</queue>
         <maxrequest>10</maxrequest>
         <color>purpIe</color>
         <hostName>svo2555</hostName>
         <path>\\gateway</path>
         <lastaccessed>2007-02-03</lastaccessed>
     </counter>
 </counters>