dbTalk Databases Forums  

Archive - DTS problem

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


Discuss Archive - DTS problem in the microsoft.public.sqlserver.dts forum.



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

Default Archive - DTS problem - 01-26-2006 , 09:31 AM






I'm trying to implement an archive operation using DTS. In this case, data
from certain tables I need to overwrite in the destination DB, so I'm using
Copy SQL Server Object task, its fine. But for certain tables, I need to
append the new rows. Here I'm using datapump task. In this scenario, when
executing the task, there may be some existing rows in the destination DB, so
I'm getting PK already existing errors. How can I copy only the non-existing
rows to the destination DB ?

Please help me in doing this using datapump task ..

TIA,
Jack


Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: Archive - DTS problem - 01-26-2006 , 09:45 PM






To import just new rows, you can use not exists to select
only the new rows...something like:
select *
from YourSourceTable
where not exists
(select *
from YourDestinationTable
where YourDestinationTable.YourPK = YourSourceTable.YourPK)

-Sue

On Thu, 26 Jan 2006 07:31:04 -0800, "Linz"
<Linz (AT) discussions (DOT) microsoft.com> wrote:

Quote:
I'm trying to implement an archive operation using DTS. In this case, data
from certain tables I need to overwrite in the destination DB, so I'm using
Copy SQL Server Object task, its fine. But for certain tables, I need to
append the new rows. Here I'm using datapump task. In this scenario, when
executing the task, there may be some existing rows in the destination DB, so
I'm getting PK already existing errors. How can I copy only the non-existing
rows to the destination DB ?

Please help me in doing this using datapump task ..

TIA,
Jack


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.