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


Configuring Transactions with Execute Package Task


Configuring Transactions with Execute Package Task

Author
Message
harishr
harishr
SSC Journeyman
SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)SSC Journeyman (84 reputation)

Group: General Forum Members
Points: 84 Visits: 1
Hello

Has any one had any experience in configuring transactions in SQL Server 2000
with the Execute package task?

I have serveral packages which encapsulate calls to stored
procedures. Each package has its own connection to the
same SQL Server.

I use another package to chain all of these other packages
together.

What I would like to happen is if a package fails all the
other packages roll back their work so nothing is
committed.

In the controlling package I have tried to set the
workflow properties
Join transaction = true
Rollback transaction = true
Fail package on step failure = true

I have also set these in the individual packages
themselves. But when I run it the individual packages
commit even if one of them fails. Or I get a message
saying that a step could not join the transaction ( MS DTC
is running).

So far the only way I can get the transaction to work is
If I execute in main thread is set for each step. But
this slows everything down.

Does anyone have any suggestions.

Thanks in advance

Harish



Jack Corbett
  Jack Corbett
SSC Guru
SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)SSC Guru (110K reputation)

Group: General Forum Members
Points: 110524 Visits: 15055
I have dealt with this in the past. If you use the transaction handling in SSIS as you have tried, it requires that DTC be running and configured correctly. The way I have handled this in the past, and I'm not saying that this is the best way, is to begin the controller package with an Execute SQL Task that issues a BEGIN TRANSACTION, and end the success with an Execute SQL Task that issues a COMMIT TRANSACTION, you need to check tran count and XACT_STATE(). Then in the Package OnError event handler have an Execute SQL Task with a ROLLBACK TRANSACTION, again checking transaction count and XACT_STATE().



Jack Corbett
Consultant Straight Path Solutions
Dont let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a QuestionHow to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
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