How to delete the duplicate records in a table using sql
server

Answers were Sorted based on User's Feedback



How to delete the duplicate records in a table using sql server..

Answer / mohamed idhris

SET ROWCOUNT 1

DELETE FROM tbl_name WHERE field_name= 'field_value'

SET ROWCOUNT 0


the above query will delete the duplicate row

Is This Answer Correct ?    4 Yes 2 No

How to delete the duplicate records in a table using sql server..

Answer / rakesh pattajoshi

delete from tbl where id not in(select max(id) from tbl group by name)

Is This Answer Correct ?    0 Yes 0 No

How to delete the duplicate records in a table using sql server..

Answer / priya

use distinct.it removes the duplicate rows

Is This Answer Correct ?    0 Yes 0 No

How to delete the duplicate records in a table using sql server..

Answer / ranjitha

Add Primary Key to the table.

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More Dot Net AllOther Interview Questions

What i sthe meaning of .(dot) in .Net?

9 Answers   HCL,


which would be the best to use inproc,outproc or sql server

2 Answers   Ness Technologies,


Can you explain server controls in atlas?

0 Answers  


What is this DLL hell problem in dotnet? Can a virtual class be created/can a virtual method be created inside the class?

3 Answers   HCL,


How to upload in video,mp4,in .net 4.5 ..?

0 Answers   HCL,






How does .net mobile work? : Microsoft dot net mobile

0 Answers  


What is the difference between abstract class and Interface? Give an example how will u write an abstract class using .NET Framework

4 Answers   T3 Softwares,


how to change row background color in gridview

0 Answers  


Explain a .net mobile example with details? : Microsoft dot net mobile

0 Answers  


6. Wcf- what is SOA

0 Answers   PCS,


Define cache? : Dot net architecture

0 Answers  


Explain hard disk and what is its purpose? : .NET Architecture

0 Answers  


Categories