Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a query to delete duplicate records in SQL SERVER

Answer Posted / sagun sawant

Name Age
chandran 23
ranjith 24
chandran 23

To delete one of the duplicate records use following query

(For sql server 2000)

Set rowcount 1
delete from [tableName] order by name
set rowcount 0
--Write a cursor to delete multiple duplicate records
Or (In sql server 2005)

;with DelDup as (select row_number() over (partition by
sname order by sname) as RONO ,sname from [TableName])
Delete from DelDup where RONO > 1

Is This Answer Correct ?    29 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use subqueries with the in operators in ms sql server?

1081


Explain few of the new features of sql server 2008 management studio

923


What are the advantages of sql stored procedure?

1079


how would you troubleshoot blocking? : Sql server database administration

989


How to write an inner join with the where clause in ms sql server?

1095


What is the purpose of sql profiler in sql server? : sql server database administration

1113


Can You Use A Stored Procedure To Provide Data To An Ssrs Report?

145


What is a matrix in ssrs?

154


Do you have any idea about the tcl commands?

968


How to view the error log for any specific instance? : sql server database administration

1046


Describe how to use the linked server?

1146


How to sort the query output with order by clauses in ms sql server?

1036


What are the advantages of using cte?

1023


How to store and query spatial data?

999


What are the advantages to use stored procedures?

1115