xml - XML 源的问题
问题描述
我正在尝试使用 SSIS 包将数据从 XML 文件加载到 SQL Server 表,但是在执行它和数据流中的 XML 源时,它一直在给我这个错误。
如果我在不同的 PC 上使用相同的 XML 文件执行它,我会收到任何错误消息,但使用公司 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.
这是使用的 XML 文件:
我该如何解决这个问题?
解决方案
您的 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>
推荐阅读
- sql-server - 获取每单位的平均值并每年过滤查询
- jmeter - JMeter - HTTP2 请求不保存 MD5 哈希
- keras - 预测具有跳跃(异常值)的输出的最佳归一化技术和 LSTM 结构是什么?
- jquery - 切换 UL 内容和更新文本
- sql - 加入 json 列?
- python - 安装程序.py 安装。找不到包初始化文件“graph\__init__.py”(或不是常规文件)
- antd - 单击后如何自动取消突出显示按钮
- ruby-on-rails - id vs name ruby 的两种方式查找
- mongodb - 如何检查字段是否存在,如果存在,在 mongodb $in 中获取其值?
- bdd - How should BDD statements be properly constructed? Is there a convention used in teams?