How To delete duplicate record from a particular table?

Answer Posted / arif jameel

ADD a new identity_column (1,1) on <table>
by

alter table <table_name>
add <Identity_column> int identity(1,1)

delete from <table> where <identity_Column> in
(select max(<identity_Column>) from <table>
group by any <table_column_name>)

drop <identity_column>

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When multiple after triggers are attached to sql table, how to control the order of execution?

538


How to get the definition of a view out of the sql server?

515


Are null values the same as that of zero or a blank space?

588


What are the benefits of normalization?

586


what type of index will get created after executing the above statement? : Sql server database administration

548






Write a code to select distinct records without using the DISTINCT keyword.

658


Does any body please help me what question's have asked for SSRS in the interview?

1678


What are information schema views?

567


where the connection string store in the database

1540


Write an sql query to sort a table according to the amounts in a row and find the second largest amount.

574


what is a mixed extent? : Sql server administration

615


What is normalization and denormalization in sql server?

549


How to convert numeric expression data types using the cast() function?

562


How is table type constraint applied to a table?

556


between cast and convert which function would you prefer and why?

557