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

set rowcount 1
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
while @@rowcount<>0
delete from stud
where (select count(*) from stud a where stud.roll_no =
a.roll_no) > 1
set rowcount 0

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1065


Can we create clustered index on composite key?

1085


Explain left outer join and right outer join?

1040


How to find Duplicate Records In table?

1018


How to return the top 5 rows from a select query in ms sql server?

1143


What does ss stand for sexually?

1086


What is failover clustering overview?

1090


What is not null constraint?

1127


How to find related tables in sql server?

947


What is the difference between a view and a stored procedure?

1038


What is the use of tempdb? What values does it hold?

1072


Tell me about the approaches which you used to counter the DI problems.

1354


List some case manipulation functions in sql?

1031


What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas

976


What is a DBMS, query, SQL?

1047