Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS import violates Primary Key

Author  Topic 

mrock
Starting Member

23 Posts

Posted - 2006-09-14 : 10:46:36
I have a primary key on the destination table for an import that I have automated in a DTS package (DBF -- SQL Server table).

Every couple of months or so, one of the source files will come in with a duplicate row. Every day I automatically download(ftp), unzip, and load via other DTS packages(one for each of 23 destination tables) to SQL Server tables.

Rather than have the package reject the entire transaction because the duplicate row is found, I would like the package to insert the first of the duplicate rows, and continue to load the rows.

Access does this after notifying that duplicates were found, you can continue, and it will continue processing.

Is there a way to let the primary key act as a filter, rather then reject all the imported records?

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-09-14 : 11:00:06
A Primary Key will not act as a filter.

You migt consider loading the data into a load table that allows duplicates, and then filtering them out as you insert them into the real target table.



CODO ERGO SUM
Go to Top of Page

Rishi Maini SQL2K5 Admin
Yak Posting Veteran

80 Posts

Posted - 2006-09-14 : 11:00:50
Does this help (Ignoring Errors in DTS and let it continue with other good rows wihtout getting stuck at the bad row )? :-

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=71106



Thanks
Rishi Maini
Go to Top of Page
   

- Advertisement -