Excluding certain tasks from transactions

  • HI All,

    I've currently got an SSIS 2008 R2 package that goes off to an Informix database, reads some data, does some transformation and puts it into a SQL Server 2008 R2 data warehouse. I'm then doing an insert into an audit table with the number of rows and times for update start and finish, this is handled in a script task:

    Control flow

    {

    Script task 1: Read audit table get last start time and create this start time.

    Data flow

    {

    Data flow 1: Read from Informix where date between last start time and this start time.

    <transformation>

    Data flow 1: Insert into SQL Server table

    }

    Script task 2: Insert into audit table

    }

    The issue I'm having is with transactions, in that if either the initial insert into my SQL Server destination table fails, or the insert into the audit table fails, the whole process should roll back. The problem lies with SSIS attempting to create a transaction on the Informix database which due to MS DTC being disabled on the Informix machine (because it runs on Linux) is failing the package from the start.

    Is there any way I can avoid creating a transaction on the data source read in my Data Flow task? Ideally the data flow would look like this:

    Control flow

    {

    Script task 1: Read audit table get last start time and create this start time.

    Data flow

    {

    Data flow 1: Read from Informix where date between last start time and this start time.

    BEGIN TRAN

    Data flow 1: Insert into SQL Server table

    }

    Script task 2: Insert into audit table

    COMMIT/ROLLBACK TRAN

    }

    Any suggestions much appreciated. I've attached a screenshot of the flow that currently lives inside a sequence container.

    Also open to redesigning the whole package as this is still in Development.

    Cheers!!

    Jim.

    SQL SERVER Central Forum Etiquette[/url]

  • Jim

    You could get your data from Informix into a SQL Server staging table, and then copy from that into your main table. Then you would only need to wrap SQL Server operations in the transaction.

    John

  • Thanks John.

    I was afraid that was going to be an answer, but it does make sense, I really shouldn't be afraid of doing more work for the right reasons!

    Can I create a temp table so I'm not creating huge numbers of tables on my database?

    Cheers,

    Jim.

    SQL SERVER Central Forum Etiquette[/url]

  • Jim

    You can use temp tables, but beware of issues with their scope and life expectancy. I think I would just create a staging table in the database. You can clear it down when the package no longer needs the data in it.

    John

  • OK, sweet as.

    I'll do some reading on temp tables and work out whether they are suitable for my purpose or not.

    Thanks for your help!

    Jim.

    SQL SERVER Central Forum Etiquette[/url]

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

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