Import problem - 10-04-2004 , 08:29 AM
I'm probaly doing something stupid here but....
I am trying to import data into a table "ImportJuliSingle" which includes
the primary key ("UserLogInName" varchar (35)) from a third party tab
delimited text file downloaded from a website on which the primary key can
appear several times - my table should have 1052 records, the text file has
50000+ records (I don't need most of the columns from this file).
When I try to run the DTS import wizard I get "Violation of Primary Key
constraint" and can't figure out why.
Re: Import problem - 10-04-2004 , 01:59 PM
You have a table with a defined PK
You are importing a text file which can contain multiple duplicates in what
is your PK column (s)
The 3rd party does not have what is universally accepted to be a Primary Key
on this atttribute as it would preclude duplicates, period.
In rows that are duplicates what is the other information for those rows?
How do you know which one of these rows you want?
The short answes is that if the info is different excepting what you term to
be the PK then you don't.
You will need to import to a staging table with no PK and either DISTINCT
the table or figre out what info you need.
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
"Paul in Harrow" <PaulinHarrow (AT) discussions (DOT) microsoft.com> wrote