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 start and end transact-sql statements?

970


What is model database? : SQL Server Architecture

1059


Are semicolons required at the end of sql statements in sql server 2005?

932


How do I get Report Builder to generate a parameter that can be set by users viewing the report?

139


what is package and it uses and how can u call a package

1952


How to count groups returned with the group by clause in ms sql server?

1006


Explain what is the purpose of sql profiler in sql server?

1009


Can we check locks in database? If so, how can we do this lock check?

893


How do you Implement SSIS Packages in your Project?

1870


What is an etl file?

900


What is the difference between composite index and covering index?

900


When should you use an instead of trigger?

918


Do you know what are pages and extents? : SQL Server Architecture

941


How do I create a partition table in sql server?

1047


What are the differences between local and global temporary tables?

1013