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

Which is faster statement or preparedstatement?

890


How to fine-tune reports?

247


Do you know what is bit data type and whats the information that can be stored inside a bit column?

909


Explain about remote stored procedure?

964


How do you troubleshoot errors in a SQL Server Agent Job?

1006


what is spatial nonclustered index

943


How can we determine what objects a user-defined function depends upon?

950


What is the fastest way to permanently delete a 1 million row table named customers?

1152


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

958


What are the benefits and tasks of object explorer? : sql server management studio

1114


How to retrieve error messages using odbc_errormsg()?

990


Which trace flags are enabled in sql server?

942


How do I setup a local sql server database?

947


How to rebuild indexes with alter index ... Rebuild?

1033


How to Update from select query in sql server?

993