Write a query to delete duplicate records in SQL SERVER

Answer Posted / abc

SELECT distinct column_names INTO temp_table FROM main_table
drop table main_table
sp_rename temp_table,main_table

Is This Answer Correct ?    19 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is outer join in sql server joins?

597


What are the differences between substr and charindex in sql server.

498


How to connect ms access to sql servers through odbc?

555


What is difference between commit and rollback when used in transactions?

501


What is Replication?

636






When do you think a developer should use sql server-based cursors?

523


How do we Backup SQL Azure Data?

86


can you implement data mining in SSRS?

113


What are the benefits of filtered indexes?

513


Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?

525


What is BCP? When does it used in sql server 2012?

579


How to execute multiple stored procedures at one time in sql server?

507


Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you

1305


How do triggers work?

540


How can you insert null values in a column while inserting the data?

721