dbTalk Databases Forums  

How not to transfer duplicates

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


Discuss How not to transfer duplicates in the microsoft.public.sqlserver.dts forum.



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

Default How not to transfer duplicates - 07-09-2003 , 02:25 PM






hi

I am new to the DTS. I have a text file and need to be
appended into a table in SQL. This is happening every month
there is a key for the table. However, the text file may
have the duplicates in the key field or the key is alreay
existing in the table in SQL. When I try to import the
data, it fails because of that. Is there any way to let
DTS know not to import any record with key value alreay
existed in the table, instead of failed the process. In
Access database, that is what exactly happens when you try
to import duplicate key value. thanks in advance.

Reply With Quote
  #2  
Old   
J O Holloway
 
Posts: n/a

Default Re: How not to transfer duplicates - 07-09-2003 , 02:46 PM






I realize this isn't the direction you want to come from, but I thought I
would throw it out to you anyway in case it helps. You can have a unique
clustered index on the table, with ignore_dup_key, instead of a primary key.
This is roughly the same as a pk, but will allow the table to ignore
attempts to insert records with keys matching a record that already is in
the table.




"wd1153" <weimindai (AT) hotmail (DOT) com> wrote

Quote:
hi

I am new to the DTS. I have a text file and need to be
appended into a table in SQL. This is happening every month
there is a key for the table. However, the text file may
have the duplicates in the key field or the key is alreay
existing in the table in SQL. When I try to import the
data, it fails because of that. Is there any way to let
DTS know not to import any record with key value alreay
existed in the table, instead of failed the process. In
Access database, that is what exactly happens when you try
to import duplicate key value. thanks in advance.



Reply With Quote
  #3  
Old   
JFB
 
Posts: n/a

Default Re: How not to transfer duplicates - 07-09-2003 , 03:17 PM



For this problem you can use lookups.
Here is an example
http://www.sqldts.com/default.aspx?6,107,277,7,1
But always is good idea to import the text file to a phisical temporary
table and then import to the master table, is good if you have errors you
always can rollback or to find duplicates keys.
JFB

"wd1153" <weimindai (AT) hotmail (DOT) com> wrote

Quote:
hi

I am new to the DTS. I have a text file and need to be
appended into a table in SQL. This is happening every month
there is a key for the table. However, the text file may
have the duplicates in the key field or the key is alreay
existing in the table in SQL. When I try to import the
data, it fails because of that. Is there any way to let
DTS know not to import any record with key value alreay
existed in the table, instead of failed the process. In
Access database, that is what exactly happens when you try
to import duplicate key value. thanks in advance.



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.