SSIS package gives error after deployment SQL Server 2012(SSIS 包在部署 SQL Server 2012 后出错)
问题描述
我在 Visual Studio 2015 中创建了一个包.它运行良好.
I created a package in Visual Studio 2015. It works fine.
基本上我正在使用一个脚本任务来生成 Excel 电子表格并将其发送给不同的用户.
Basically I am using a script task that generates Excel spreadsheet and sends it to different users.
在我将包部署到 SQL Server 2012 并尝试从那里执行之后 - 我收到一个没有任何进一步细节的错误.
After I deploy the package to SQL Server 2012 and then try to execute it from there - I get an error without any further details.
我还从 SSISDB 运行 select * from internal.packages 以确保 package_format_version 为 6,这应该是 SQL Server 2012 的值.
I also run select * from internal.packages from SSISDB to make sure package_format_version is 6, which is what should be for SQL Server 2012.
可能是什么问题?
推荐答案
这不一定是关于如何解决问题的答案,而是关于如何修改脚本任务以获得更好的错误消息的答案脚本任务失败:已抛出异常..."
This necessarily isn't an answer on how to fix the issue, but it's an answer on how you can modify your script task to get a better error message then "Script Task Failure: Exception has been thrown..."
我们总是将我们的脚本任务包装在一个 try-catch 中,然后将异常消息从脚本任务中抛出:
We'll always wrap our script tasks in a try-catch and then raise the exception message back out of the script task:
public void Main()
{
try
{
//Your code here
Dts.TaskResult = (int)ScriptResults.Success;
}
catch (Exception ex)
{
Dts.Events.FireError(-1, "", ex.Message, String.Empty, 0);
Dts.TaskResult = (int)ScriptResults.Failure;
}
}
这始终是一个挑战,尤其是对于已部署的 SSIS 包,当它在脚本任务上出错时,您不一定能清楚地了解它失败的原因,并且您会收到一条神秘的错误消息.上面的代码将捕获抛出异常的内容并将其返回给集成服务.
It's always a challenge, especially with a deployed SSIS package, when it errors on a scrip task you don't necessarily get a clear indication as to why it's failing and you get a cryptic error message. The above code will capture what threw the exception and bubble back out to integration services what that was.
这篇关于SSIS 包在部署 SQL Server 2012 后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SSIS 包在部署 SQL Server 2012 后出错
基础教程推荐
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在多列上分布任意行 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
