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 ?
问题:
回答1:
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.
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.
You can read an explanation of the TransactionOption property here and/or follow the walkthrough here to see how to implement this.
EDIT: Another good walkthrough (with screenshots) here