Rollback in SSIS

  • What I want to achieve is to have a Rollback on the inserts when any one of the tasks fail in the container (By a method other than using Event Handlers).

    I have created a package with a container containing two tasks.

    Task1: Execute SQL Task-> Here I’m truncating a table which I want to load.

    Task 2: Dataflow Task->Here I am loading the data.

    I want that if Task 2 fails then there should be no truncation in its previous task.

    I have used:

    i) Transaction option as “Required”

    ii) Started the MSDTC

    Any help on this will be much appreciated.

    Cheers

  • Sequence Container will help your problem. Sequence container commits the transaction if it completes successfully, an it rolls backs the transaction if it fails any one of the execution

    In Sequence Container simply configuring the TransactionOption property to have the value REQUIRED.

    🙂

  • Thanks for the reply sudhir!

    Well thats what I was doing exactly but because I was initially Truncating the tables instead of Delete, I was not able to rollback.

    Got it sorted !

    Sometime sanity gets to its bare minimum 🙂

    Cheers

  • Sridhar-329062 - Thursday, May 21, 2009 9:53 PM

    Thanks for the reply sudhir! Well thats what I was doing exactly but because I was initially Truncating the tables instead of Delete, I was not able to rollback.Got it sorted !Sometime sanity gets to its bare minimum :-)Cheers

    how you achieved that .can u explain?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply