How to delete the duplicate rows from a table in SQL Server ??

Answer Posted / sudha511

select distinct * into #temp from sampletbl
delete sampletbl
insert into sampletbl
select * from #temp
drop table #temp

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can foreign key be deleted?

523


What are the properties and different types of sub-queries?

558


What extended events?

540


What is attribute hierarchy? : sql server analysis services, ssas

513


Can a database be shrunk with users active?

596






What are the advantages of sql azure?

116


What do you mean by an execution plan? Why is it used?

526


Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?

106


What do you understand by mirroring?

562


Which is the latest version of sql server and when it is released?

541


What are drillthrough reports?

102


How does stuff differ from the replace function?

549


Why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it?

491


What is lock escalation and what is its purpose?

555


What is partitioned view?

521