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

problem with duplicates 1

Status
Not open for further replies.

Leakyradiator

Technical User
Jul 12, 2002
35
US
Hi:

I have a database with duplicate records. Apparently, "overwrite existing date" was not selected when using DTS, so all the data exists twice (including primary keys).

I tried to delete the items using Enterprise manager, and it wouldn't let me do it. I don't know how to delete a duplicate record using SQL (with out deleting both records). Any advice is greatly appreciated.

 
One common method for removing duplicates is to create a second identical table and then
Code:
 SELECT DISTINCT *
into the new table, followed by deleting the original and renaming the new (or clearing out the original and copying back all of the records from the temp table).
 
Genimuse,

I had a table that had ID numbers as follows:

10114
10114
10114
10114
10114
10652
10652
10652
10652
10652
22454
22454
22454
22454

etc...

I was playing around for ages with creating recordsets and using nomatch etc to no avail... this is a perfect answer so have a star!

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top