Integration Services Roll back on Failure

Posted on 2007-07-26
Last Modified: 2013-11-30
I am new to integration services (sql server 2005) and am trying to set up a DTS package (SSIS Package).

In old sql, I would make a package.   As part of the package I would make it a transaction and roll back on failure.

I have a oracle database and a SQL database.  I want to import from oracle.table1 into sql.table1, replacing the rows in sql.table1 with those from oracle.  Using the wizard, it provides a turncate statement followed by a dataflow of import.

However, I need it to roll back to pre-turncate if the import fails.  What step am i missing?
Question by:kevinscheidt
    LVL 12

    Accepted Solution

    As TRUNCATE TABLE is nonlogged you have to replace it by DELETE. Than you could setup transaction arround it and rollback in case of error.
    LVL 12

    Assisted Solution


    Author Comment

    In the preparation step, I set it to "DELETE FROM TABLE X" instead of truncate.

    I put a Sequence Container around the Control flow and set it to Transaction Required.
    Thus, does this now mean that if the DataFlow Task fails, then the Transaction will roll back and undo the Preparation SQL task?
    LVL 12

    Expert Comment

    Yes, from what you wrtite it looks right. But please do the test example first before going to destroy production data :) :)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now