SQL Server Performance

Import Records from Table1 to Table2 - Excluding Duplicate Record

Discussion in 'SQL Server 2005 Integration Services' started by Jon M, Jun 24, 2008.

  1. Jon M Member

    Hi All,
    I am trying to import records from table1 to table2 but I want to exclude table1 records that are already existing on table2. If the same table1 record exists on table2, I want to store the table1 record on another table (like an error log table) and exclude that record from import. If table1 record is not existing on table2, proceed with import to table2.
    What is the best way to implement the above using SQL Server 2005 SSIS?
    Thanks,
    Jon M
  2. techbabu303 New Member

    Hi,
    If these tables are in same database and this is going to be when no users are INSERTINGUPDATINGDELETING on this table , I would suggest simple query to do it.
    How many records approximately are we looking to import ? if this number is say more than 1M then probably SSIS.
    -Cheers
    Sat
  3. Jon M Member

    Thanks for the reply, Sat.
    I got this working on SSIS using Fuzzy Lookup and Conditional Split.
    Jon M
  4. dineshasanka Moderator

    You can use lookup fuzzy lookups are costly.
    you don't have to use Conditional Split
    Instead you can use , error output of the lookup to do the new report stuff and the other to do what you want to do for the existing records.
    Alternatively, you can use Merge and Conditional Split

Share This Page