在 SSIS 中执行 Sql 任务时出错 [英] Error on Executing Sql Task in SSIS

查看:38
本文介绍了在 SSIS 中执行 Sql 任务时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过 SSIS 将变量中的数据插入数据库,我使用了 Execute XML Task,下面是屏幕截图,并且还在我的 sql server 中创建了存储过程来插入数据,Data 是我的用户变量,它以 xml 文件格式存储来自 web 服务任务的结果,但是这个 SQL EXECUTE 任务没有执行

这是参数映射页面即使我通过查询将 sql 语句替换为插入到 dbo.Data_Result(Result) values('1')"并删除映射参数,它仍然显示执行中的错误.

不...任务没有触发,它实际上没有显示任何错误...抱歉解释错误,我的网络服务任务成功执行但执行 XML 任务没有执行.

下面是我的流程在 Web 服务任务中,我使用我的简单 Web 服务添加数字并返回变量中的数据,我必须在执行 XML 任务中使用该变量才能在 sql 数据库中输入添加的结果.

解决方案

在参数映射窗口中,参数名称需要包含一个整数值,从零开始,而不是存储过程中定义的参数名称.此整数值映射到 SqlStatement 属性中的问号.

您有一个要映射的参数,因此您应该在参数名称"中使用零值.使用的整数值应映射到该参数在存储过程调用中出现的位置.

例如,如果您向存储过程添加第二个参数,您将首先向 SqlStatement 属性添加另一个问号,然后在映射屏幕中添加第二个参数,参数名称的值为 1.

I was trying to insert data from variable into database via SSIS, I made use of Execute XML Task, below is the screenshot, and also created the stored procedure in my sql server to insert data and Data is my user variable which stores the result in xml file format from web service task, but this SQL EXECUTE Task is not executing

this is parameter mapping page Even if I replace the sql statement by query as "insert into dbo.Data_Result(Result) values('1')" and remove the mapping parameter still it shows the error in execution.

No...task does not fire, it doesnot show any errors actually..sorry for wrong explanation, my web service task executes successfully but Execute XML Task does not executes.

Below is my flow In web service task I have used my simple web service to add the numbers and returns the data in variable, that variable I have to use in Execute XML Task to enter that added result in sql Database.

解决方案

Within the Parameter Mapping window, the Parameter Name needs to contain an integer value, starting with zero, not the name of the parameter as defined in the stored procedure. This integer value maps to the question mark in the SqlStatement property.

You have one parameter to map, so you should use the value zero in the Parameter Name. The integer value used should map to the position that that parameter appears in the call to the stored procedure.

For example, if you add a second parameter to the stored procedure, you would first add another question mark to the SqlStatement property and then add a second parameter in the mapping screen with a value of 1 for the Parameter name.

这篇关于在 SSIS 中执行 Sql 任务时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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