Write a query to delete duplicate records in SQL SERVER

Answer Posted / skumar

Hi friends, please just try out this. This works fine for me.

We have lot of methods to do this. But using temp table,
drop the original table,retain the temp as orinial is not a
good pratice.

When u have large no of data it will affect ur performance.


DELETE FROM employee WHERE((SELECT eid,COUNT(eid) FROM
employee GROUP BY eid) > 1)

Is This Answer Correct ?    15 Yes 46 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the datatype of rowid?

583


Ways to improve the performance of a SQL Azure Database?

109


how you can configure a running aggregate in SSRS?

125


Explain “row_number()” in sql server with an example?

621


How to change the password of a login name in ms sql server?

637






What are different types of subquery?

816


What are the components of dbms?

610


What is the difference between char, varchar and nvarchar?

671


Write an sql query for deleting duplicate rows?

634


What are the rendering extensions of ssrs?

113


What is a group function explain with an example?

619


How do I schedule a sql server profiler trace?

613


How use inner join in sql server?

702


What is a non-clustered index?

640


What is difference between delete & truncate commands?

621