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

You want to implement the one-to-one relationship while designing tables. How would you do it?

957


Can select statements be used on views in ms sql server?

1056


What is multi-statement table-value user-defined function?

983


What are out-of-range errors with date and time literals?

1025


Explain features of analysis services?

986


What is the native system stored procedure to execute a command against all databases?

1013


Why functions are used in sql server?

950


What is molap and its advantage? : sql server analysis services, ssas

980


You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?

155


What is the difference between mysql and sql server?

1007


Define cursor locking

993


What are logical/boolean operations in ms sql server?

1028


What is an identity column in insert statements?

1014


You have modified 100 store procedures and want to replicate these changes from development to prodution, and production can have users using the Server/DB, how would you replicate without causing issues?

2138


What are drillthrough reports?

155