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 / vineet dhamija

the best approach i came across in simple form too
just create a temporary table with the distinct values and
truncate this table than copy the values back and u r good to go
select distinct * into #temp from urtable
truncate table urtable
insert into urtable select * from #temp
drop table #temp

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by cardinality?

904


Explain what are page splits? : SQL Server Architecture

1072


What are the steps to insert a table?

948


When a primary key constraint is included in a table, what other constraints does this imply?

989


How to delete duplicate rows from table except one?

994


how many clustered indexes can be created on a table? : Sql server database administration

1159


What are the types of subscriptions in SQL Server replication?

1043


What is log cache in sql server?

1051


What is dbcc? Give few examples.

1043


What does the on update no action do?

1032


Does transparent data encryption provide encryption when transmitting data across the network?

1053


What is the current limitation of the size of SQL Azure DB?

127


Explain how to use linked server?

999


What’s the distinction between dropping a info and taking a info offline?

1040


Which table keeps information about stored procedures?

944