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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete duplicate data from csv file before it uploads

Status
Not open for further replies.

bloko

Programmer
Feb 22, 2010
26
GB
I am uploading a csv file to an SQL database, but its coming up with errors because the incident number, which is a primary key in the database, is used in more than one of the records. I only need to enter 1 of the incident numbers records to the database as it is used as count to produce a graph. Any ideas anyone?
 

How about bringing it into a staging table first with out the primary key then remove your duplicates and more it into your final table.

I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
Are all the columns duplicate or is it just the incident? If it is just the incident how do you determine which is suppsed to be deleted?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top