dbTalk Databases Forums  

Import problem

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


Discuss Import problem in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul in Harrow
 
Posts: n/a

Default Import problem - 10-04-2004 , 08:29 AM






Hi there,
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.
Help please
Thanks
Paul.


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default 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.
www.Konesans.com


"Paul in Harrow" <PaulinHarrow (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi there,
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.
Help please
Thanks
Paul.




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 - 2013, Jelsoft Enterprises Ltd.