作为作业运行时 SSIS 变量不包含正确的值
在 ssis(2005) 中,我使用执行 SQL 任务来调用存储过程。存储过程需要 3 个参数,所有 3 个参数都是 ssis 变量。我的包在开发中执行没有问题,但作为作业运行时失败。
日志提供以下消息:执行查询“Exec nx_sp_WriteFLHeader ?,?,?”失败并出现以下错误:“未指定的错误”。可能的失败原因:查询问题、“ResultSet”属性设置不正确、参数设置不正确或连接未正确建立。
使用 Sql 服务器分析器,我可以看到存储过程被调用时使用了不正确的值,(1,null,null) 在 dev 中,它会是类似 454,404,"sometext" 的东西。
当作为作业运行时,我可以看到 ssis 变量在其他任务中成功使用,这是因为当我尝试使用它们时变量超出了范围。我确实在最高级别声明了变量。
谢谢
已解决:在执行 SQL 任务的参数映射部分中,参数的数据类型之一被定义为数字。将其更改为 Long 后,我的工作执行成功。我传递的 ssis 变量被声明为 int32。
In ssis(2005) I am using an execute SQL task to call a stored procedure. The stored procedure takes 3 params, all 3 are ssis variables. My package executes without problem in dev but fails when running as a job.
The log gives the following msg: Executing the query "Exec nx_sp_WriteFLHeader ?,?,?" failed with the following error: "Unspecified error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Using Sql server profiler I can see the stored procedure is called with incorrect values, (1,null,null) in dev it would be somthing like 454,404,"sometext".
When running as a job I can see the ssis variables successfully being used in in other tasks, it is if the variables are out of scope by the time I am trying to use them. I did declare the variables at the highest level.
Thanks
Solved: In the execute SQL task, Parameter Mapping section, one of the parameter's Data Type's was defined as Numeric. After changing it to Long my job executes successfully. The ssis variable I am passing was declared as an int32.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已解决:在执行 SQL 任务的参数映射部分中,参数的数据类型之一被定义为数字。将其更改为 Long 后,我的工作执行成功。我传递的 ssis 变量被声明为 int32。
Solved: In the execute SQL task, Parameter Mapping section, one of the parameter's Data Type's was defined as Numeric. After changing it to Long my job executes successfully. The ssis variable I am passing was declared as an int32.