[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

query to delete duplicate records in SQL server

Posted on 2009-02-19
3
Medium Priority
?
692 Views
Last Modified: 2012-05-06
Can anyone please give me the query to delete duplicate records in SQL server?
0
Comment
Question by:sarcharan
  • 2
3 Comments
 
LVL 5

Expert Comment

by:JohnSingleton
ID: 23680567
you'll have to be more specific.... do you have an identity field? PK?

-John
0
 
LVL 19

Expert Comment

by:daveamour
ID: 23680570
That depends on your table design and what criteria you are using to say that two records are equal.
Can you give us this info?
0
 
LVL 19

Accepted Solution

by:
daveamour earned 60 total points
ID: 23680600
In any case this may help:
http://www.sql-server-performance.com/articles/dba/delete_duplicates_p1.aspx
You may just have to tinker with it depending on your criteria for duplicateness
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question