SQL Server Destination : delete in table before bulk inserting?

  • Hi all,

    I'm reading from a text file, applying a conditional split, then I'm inserting the correct data in the DB using Sql Server Destination. It has automatically created a table for me, which is nice, but what I'd like to do is delete the old data before I insert the new one.

    Do I need to write a sql statement and put it before the insert, or there must be some easy option I'm missing that does that automatically...

    Thanks in advance,

    Cheers,

    J-F

  • If you want to delete data from the table before loading it, you will have to do that explicitly with an Execute SQL task in the Control Flow of your package.

    One suggestion - you might want to use the OleDB Destination instead of the SQL Server destination, even though you are writing to a SQL Server database. The SQL Server destination adapter is quirky at best, while the OleDB Destination is much more reliable.

    hth,

    Tim

    Tim Mitchell, Microsoft Data Platform MVP
    Data Warehouse and ETL Consultant
    TimMitchell.net | @Tim_Mitchell | Tyleris.com
    ETL Best Practices

  • Thanks Tim, it worked perfectly! I also changed to put a OleDB Destination as you mentionned. Thanks a lot!

    Cheers,

    J-F

Viewing 3 posts - 1 through 2 (of 2 total)

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