all groups > sql server dts > april 2006 >
You're in the

sql server dts

group:

Duplicate Key Skip?


Duplicate Key Skip? MikeV06
4/28/2006 3:39:42 PM
sql server dts:
I am trying to use DTS to copy from an Excel file to a table (SQL 2000).
The table has a primary key (say ID). As might be expected, when a
duplicate key is detected, it terminates the copy. With Access one could
use First/INTO/Group and have the copy just skip the duplicate. I cannot
use DISTINCT since the key may be duplicated but the name might not be.

How does on accomplish this using SQL Server?

Re: Duplicate Key Skip? Allan Mitchell
4/28/2006 5:03:12 PM
The problem here then is that what one system calls a key is not what the
other one defines as a key.. In the Access method surely you are ignoring
rows of data. How do you decide which row with the same key is for the chop
or is it arbitrary?

You can do this a number of ways and these range from using Lookups within
the pump to see if you already have the value in the destination to pumping
to a working table and then using something like MIN or MAX to get a row
with the same key value. There are other ways as well.



--


Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com


[quoted text, click to view]

Re: Duplicate Key Skip? MikeV06
4/29/2006 10:20:53 AM
[quoted text, click to view]

Thanks. I ended up writing a quick VB Script using a save variable to see
AddThis Social Bookmark Button