手动停止ssis包时删除记录 [英] Delete a record when the ssis package manually stopped

查看:181
本文介绍了手动停止ssis包时删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当手动停止运行SSIS包时,我需要删除一条记录。



i设计了一个只在一个会话中运行一次的包,实现我插入一个包开始前记录。所以当行存在时,其他执行将不允许。如果出现错误或成功运行,我会自动删除该行。



现在我有一个场景,那时SSIS包手动停止需要删除该行以允许其他会话执行。



请帮忙解决。

I need to delete a record when the running SSIS package stopped manually.

i designed a package to run only once across a session, to achieve that I insert a record before package started. so other execution will not allow when row exists. if error came or on successful run i deleted the row automatically.

now i have a scenario that the SSIS package stopped manually at that time need to delete the row to allow other session execution.

Kindly help to resolve it.

推荐答案

最好的解决方案是手动删除记录手动停止SSIS包时从数据库中获取。



或以特定的最佳间隔运行作业,这将自动删除该记录。

所以,即使你没有做到这一点,系统也会在一定的时间间隔之后处理它。
The best possible solutions are either you delete the record manually from the database when the SSIS package is stopped manually.

Or Run a job at certain optimum intervals which will automatically delete that record.
So even if you fail to do it manuallt the system will take care of it after certain interval.


只在包中插入记录。

在事务中运行完整的包。

在Package的第一步提出一个条件:如果记录存在exit package
Insert the record with in the package only.
Run the complete package in transaction.
At first step in Package put a condition : if record exists "exit package"


如果是SQL Server 2012或更高版本,则可以查询SSISDB数据库以确定先前执行的状态。您可以使用该信息而不是信号量行。
If SQL Server 2012 or newer, you can query the SSISDB database to determine the status of previous executions. You can use that information rather than a semaphore row.


这篇关于手动停止ssis包时删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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