delete emp table data using ssis package

送分小仙女□ 提交于 2020-06-17 12:56:03

问题


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

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.

[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.

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

how to avoid this issue in ssis package?


回答1:


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 - Execute SQL Task Editor



来源:https://stackoverflow.com/questions/61379666/delete-emp-table-data-using-ssis-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!