Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Can I use transactions for non database related control flow tasks Expand / Collapse
Posted Wednesday, February 20, 2013 9:54 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, November 14, 2016 3:09 PM
Points: 558, Visits: 879

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)
Post #1422165
Posted Thursday, February 21, 2013 9:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 1, 2016 5:14 PM
Points: 27, 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.
Post #1422665
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse