dbTalk Databases Forums  

DTS Function to Compare 2 Tables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Function to Compare 2 Tables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RC-
 
Posts: n/a

Default DTS Function to Compare 2 Tables - 12-16-2005 , 11:24 AM






I have two tables that I need to compare. The purpose of the comparison is
to check for duplicate records, or better said, check for new records in the
newer table. I then want to add the new records to the old table. The
newer table is expendable but the older table is the actual production
table.

I hope this post makes sense, if anyone needs more clarification, please let
me know.

TIA
RC-



Reply With Quote
  #2  
Old   
vadim.svinkin@gmail.com
 
Posts: n/a

Default Re: DTS Function to Compare 2 Tables - 12-19-2005 , 08:42 AM







RC- wrote:
Quote:
I have two tables that I need to compare. The purpose of the comparison is
to check for duplicate records, or better said, check for new records in the
newer table. I then want to add the new records to the old table. The
newer table is expendable but the older table is the actual production
table.

I hope this post makes sense, if anyone needs more clarification, please let
me know.

TIA
RC-
You can write a simple SQL task:
select * from Table1 where id_field NOT IN (select id_field from table2
where datefield > somedate)
You can insert the result set into some temp table and in the next task
punp it into you target table.
I included where clause with date in it, cause it could be useful in
many queries.
Good luck.

Vadim



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.