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


Can I use transactions for non database related control flow tasks


Can I use transactions for non database related control flow tasks

Author
Message
aaron.reese
aaron.reese
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1039 Visits: 902
Guys,

I have a package that has two tasks. The first is an SQL task which updates two tables (batch headers and batch lines) with some details of an extract file (filename, status etc..)
The second is a DataFlow task that takes these records and generates the file oleSource to flatfileDestination

The testers asked me what happens if the file fails to write (lets say that for some reason the target path is not available; folder is wrongly named or remote server is off-line)

I have wrapped the two tasks in a Sequence container and set TransactionOption to Required. [The package doesn't run because MSDTC is not active on the server but that is a separate issue. ]

Will this work within a transaction or do I need a different approach (the alternative is to write additional steps to undo the update if the dataflow task fails, but this takes more work for something which will should never happen)
mthurber
mthurber
SSC Rookie
SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)SSC Rookie (47 reputation)

Group: General Forum Members
Points: 47 Visits: 909
That's the right way to begin, I think. Setting the TransactionOption to Required on the container will cause the container to start a transaction. Now you should set TransactionOption to Supported on the tasks within the container, so they will participate in the container's transaction.
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