导入Excel(.xlsx)文件时意外终止 [英] Unexpected Termination when importing an Excel (.xlsx) file

查看:141
本文介绍了导入Excel(.xlsx)文件时意外终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SQL Server 2016中,我目前遇到"意外终止"通过SSMS对象资源管理器或作为SQL Server代理中的作业执行SSIS包时出错。当我在Visual Studio中本地运行
时,包将始终成功执行,但是当我将其部署到服务器时,包始终在数据流任务步骤中终止,在该步骤中,它从Excel读取数据(.xlsx )文件。

In SQL Server 2016, I am currently experiencing an "Unexpected Termination" error when executing an SSIS package either via the SSMS Object Explorer or as a job in SQL Server Agent. The package will always execute successfully when I run it locally in Visual Studio, but when I deploy it to the server, the package always terminates during a Data Flow Task step in which it is reading data from an Excel (.xlsx) file.

我试图利用Excel源连接以及源脚本组件,但错误始终相同,并且始终在数据流任务结束时发生。

I have attempted to utilize an Excel Source Connection as well as a Source Script Component but the error is always the same and it will always occurs near the end of the Data Flow Task.

我已确认以下内容:


  • 包将确认该文件并从中读取。我能够看到excel文件中的部分或全部数据已加载到目标表。但是,它总是会返回"意外终止"。当某些或
    导入了所有数据时。
  • 没有使用环境变量。这些值在服务器上运行时与Visual Studio中使用的值相同。
  • 我使用了详细日志记录并为SQL Server创建了一个SSIS日志提供程序,但在执行时都没有显示任何错误。
  • 我试图通过脚本任务将文件转换为.xls和.csv,但错误仍然存​​在。
  • 我没有父子包关系。这是一个独立的软件包,不能通过另一个软件包执行。
  • 我已经确认已经为相应的帐户提供了必要的权限,特别是因为我使用自己的帐户手动执行软件包。
  • 我安装了2010和2016 Microsoft Access数据库引擎驱动程序。

非常感谢,

Nate

推荐答案

嗨Nate,

没有进一步的细节关于包的实现方式,很难判断出什么是错的,但关键部分在我看来是你说它确认文件的部分和"当部分或全部数据被导入时"。它失败。

without further details on how the package is implemented it is hard to judge what's wrong, but the key pieces appear to me being the parts where you say it acknowledges a file and "when some or all of the data has been imported" it fails.

所以我想在这里每次文件被删除时都将Excel数据加载到表中。因此,当没有以高速率存放文件时,它从SSMS运行。

So I am fantasizing here you load the Excel data into a table each time a file gets dropped. Therefore, it runs from SSMS when there are no files deposited at a high rate.

这反过来让我相信在导入文件时外部进程尝试写入它的文件或者甚至最糟糕的是,当过程正在写入时,你会从中读取,从而产生这个错误。

Which in turn makes me believe while you import the file an external process tries to write to the very file it or perhaps even worst you read from it when the process is writing thereby generating this error.


这篇关于导入Excel(.xlsx)文件时意外终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆