Home > Archive > MS SQL Server DTS > January 2006 > Archive - DTS problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Archive - DTS problem
Linz

2006-01-26, 4:58 pm

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

Sue Hoegemeier

2006-01-27, 3:23 am

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@discussions.microsoft.com> wrote:

>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


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com