SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Rollback in SSIS


Rollback in SSIS

Author
Message
Sridhar-329062
Sridhar-329062
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 114
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
vksudhir
vksudhir
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 25
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.

:-)
Sridhar-329062
Sridhar-329062
Grasshopper
Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)Grasshopper (18 reputation)

Group: General Forum Members
Points: 18 Visits: 114
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search