Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluding Duplicate Rows from Import

Status
Not open for further replies.

mikew71

MIS
Mar 17, 2005
29
GB
Hi, I'm brining a txt file in via a simple import procedure, I have duplicate client ID's on the source file that I want to exclude. The primary key method won't do this, is there another way?

 
Create an unique index on clientID.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I've tried that as part of the import process, ie selecting 'Yes (No Dulpicates)' on the index option, unfortunatly it didn't work.
 
unfortunatly it didn't work
Any chance you could elaborate ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
sorry, the duplicate records were imported from the source. I attemped to apply the primary key on the client ID but it would not import due to duplicate rows being present. Have then tried running a delete query where count of all records > 1 were deleted, which then (obviously) deleted all the records with a duplicate value. I'm sure I've excluded records in the past using the primary key but can't do it this time.

 
You may import in a temporary table and then run an append query in your final table that has an unique index on clientID.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top