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...

how to delete duplicate rows from table in sql server

Answer Posted / debasish

while @@rowcount != 0
begin
delete top (1) test where columnname in
(
select columnname
FROM tablename
GROUP BY columnname having count(*)>1
)
end

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is bcp? When does it use?

915


Are there issues when exporting SSRS reports into Microsoft Excel? When my users are trying to export a SSRS report into Microsoft Excel, one or two columns in the report appear to merge together. Why might this be?

189


Explain the ways to controlling cursor behavior?

901


List the ways in which dynamic sql can be executed?

1002


what changed between the previous version of sql server and the current version? : Sql server database administration

985


How to convert character strings into numeric values?

1077


What is an indice?

1013


Can one drop a column from a table?

1001


how to create “alternate row colour”?

146


How to create a simple stored procedure in ms sql server?

1011


I create a separate index on each column of a table. What are the advantages and disadvantages of this approach? : Sql server database administration

1070


How to maintain a fill factor in existing indexes?

985


What is transact-sql ddl trigger?

1083


What are the system database in sql server 2005?

1026


Can I disable or restrict ssrs export formats (rendering formats)?

148