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 / bala_it243

using the following query u can delete the duplicate records.
but it is available only on SQL Server 2005.

with mytable as
(
select *, ROW_NUMBER() OVER(partition by id,myname order by
id desc) as RowNumber from test
)
delete from mytable where rownumber>1


"Have a Great Day"

Bala

Is This Answer Correct ?    16 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different editions available in sql server 2000?

1052


How fixed length strings are truncated and padded?

980


What is clustered index

1010


What is partition in sql server?

1038


Explain different types of locks in sql server.

1079


What is pivot and unpivot?

1013


What is left outer join in sql server joins?

1042


What is the distinction amongst delete and truncate?

1071


What is transaction server explicit transaction?

1029


Explain about link server in sql server?

1061


How to scale out a federation by Sql statement?

116


What is a schema in ms sql server 2005?

970


Explain filestream storage of sql server 2008?

1016


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

1041


What is a View ? Can we insert, Update and delete a view?

995