Write a query to delete duplicate records in SQL SERVER
Answer Posted / vaishali
set rowcount 1
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
while @@rowcount<>0
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
set rowcount 0
Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
What the different types of Replication and why are they used?
sql database suspect We have a sql database that is showing as suspect. How can we recover?
What are the advantages of partitioning?
What are the character string functions supported by sql server 2005?
Explain error and transaction handling in sql server?
Define inner join in sql server joins?
What is a view and what are its advantages?
Explain microsoft sql server functions?
How to delete exactly duplicate records from a table?
Can you leave a union at any time?
what is a default tcp/ip socket assigned for sql server? : Sql server database administration
You have several tables, and they are joined together for querying. The tables contain both clustered indexes and non clustered indexes to optimize performance, how should you distribute the tables and their indexes onto different file groups?
What is dml command?
Tell me extended events in sql server 2008?