使用ssis包删除emp表数据 [英] delete emp table data using ssis package

查看:315
本文介绍了使用ssis包删除emp表数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ssis软件包删除目标服务器(postgres)表中的数据。

I want delete the data in the target server(postgres) tables data using ssis package.

database : postgres server 
Table : emp
in execute sql task :scriptis:  delete from emp and connection used odbc

当我在sis包
中运行exec任务时,如果emp表中有数据,那么它的工作正常,当emp表中没有数据时,我得到了错误。

when i run the executesql task in ssis package if emp table have data then its working fine and i am getting the error when emp table donot have data.


[执行SQL任务]错误:执行查询从emp
usin ...中删除...失败,并出现以下错误:错误HRESULT E_FAIL已从调用返回一个COM组件。。可能的失败原因:查询问题, ResultSet属性未正确设置,参数未正确设置或连接未正确建立。

[Execute SQL Task] Error: Executing the query "delete from emp usin..." failed with the following error: "Error HRESULT E_FAIL has been returned from a call to a COM component.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

假设如果我在pgadmin工具中运行相同的查询,即使emp表没有数据,那次也没有收到任何错误。

suppose if i run same query in pgadmin tool that time it is not getting any error even though emp table donot have data.

如何避免在sis软件包中出现此问题?

how to avoid this issue in ssis package?

推荐答案

如果我理解正确,则DELETE语句包含该连接。我想您已经将ODBC连接管理器传递给了执行SQL任务属性-连接类型和连接。然后您的SQL脚本可能就是:
从emp删除;

If I understand correctly, The DELETE statement contains the connection. I guess you have passed the ODBC connection manager to the Execute SQL Task properties - Connection Type and Connection. Then your SQL script could be just: DELETE FROM emp;

SSIS-执行SQL任务编辑器

这篇关于使用ssis包删除emp表数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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