Updating records

  • In relation to my previous posted problem, I encountered another problem. Not a bug but just a question about the implementation to this problem.
    Simple situation. I have imported some records (e.g. flatfile, database, images) and I want check if these record are already in the database. If not, import them otherwise update them.
    What the best, most simple approach? 
     
  • I'd do it in two steps. First, do an update on records where the keys match. Then do a left join with an insert to records where the keys don't exist. It's simple & batch oriented so you avoid cursor type actions. Even in SSIS, SQL Server is a batch oriented processor.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Ok, but is this update done via a custom script where I create a dataadapter. Because I already implemented this and I was wondering if this is the most simple way.

    Maybe you can also answer another question. I want to use the recordset from one dataflow to another dataflow but I can't discover if this possible. I tried it with a DataReader Destination but mine search ends there.

     

  • I haven't done it myself, yet, but it is possible to add a recordset as a variable and then you can pass it around as needed. Here's one article on how to do it (http://www.sqlis.com/default.aspx?59). I've seen some others.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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