Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Green Bay

    Unanswered: Delete/Insert/ Process Help

    I have a process that gets an input file that is 700k

    I have a hist table that is 2 mill

    I need to append the input file to the hist table
    and update any similar based on key records.

    I am doing the following
    Import File into input table (no indexing)
    Delete from Hist table where exists (index on Hist table)
    Insert into Hist table all records.

    Can someone suggest a different approch or is this the best way to do this.
    I don't want to delete if I don't have to
    I don't want to update

    Any insight would be appreciated

    I am thinking of creatating a temp table to hold the output of a select statement, Truncate hist table then insert all into hist table.
    Last edited by rbackmann; 10-10-05 at 10:51.

  2. #2
    Join Date
    Mar 2002
    Reading, UK
    Look up the MERGE command in the SQL reference manual as that can do insert or update. Dont know if it will be quicker but give it a go.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts