如何在ssis中进行事务回滚? [英] How to transaction rollback in ssis?

查看:33
本文介绍了如何在ssis中进行事务回滚?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据导入到生产服务器.在我的包中,在数据加载之前清理原始表.如果任何情况下包失败.如何在 SSIS 中回滚原始表数据?

I have data import to Production server. In my package cleanse raw tables before data load. If any case package failed . How to rollback raw tables data in SSIS ?

推荐答案

通过在 SSIS 中使用 Sequence Containers(Sequence、For Loop、ForEach Loop),您可以利用一个名为 交易选项.这允许您指定包中任务的事务行为,以及包本身在任何任务失败时回滚.

By using Sequence Containers (Sequence, For Loop, ForEach Loop) in SSIS, you can make use of a property called TransactionOption. This allows you to specify the transactional behaviour of the tasks in your package, and the package itself to rollback if any tasks fail.

例如,如果你把你的任务放在一个序列容器中并设置TransactionOption=Required,并将容器内的所有任务配置为TransactionOption=Supported,它们将全部加入在Sequence Container中启动的事务,如果有任何失败,事务将被回滚.

For example, if you stick your tasks in a Sequence Container and set TransactionOption=Required, and configure all Tasks within the Container to TransactionOption=Supported, they will all join the transaction started in the Sequence Container, and if any fail, the transaction will be rolled back.

您可以在此处阅读对 TransactionOption 属性的说明和/或按照此处演练以了解如何实现这一点.

You can read an explanation of the TransactionOption property here and/or follow the walkthrough here to see how to implement this.

另一个很好的演练(有截图)在这里

这篇关于如何在ssis中进行事务回滚?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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