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 understand by physical_only option in dbcc checkdb?

965


Explain about SQL server 2005?

956


What are the steps to follow to configure SQL*Net?

1018


Is resultset an interface?

938


What is resource governor in sql server?

973


Can foreign key be deleted?

904


can an order by clause be used in a creation of a view?

1153


How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?

1088


What is public role in sql server?

1123


What is a ddl statement?

889


What is intellisense?

1026


What is clustered vs nonclustered index?

931


How do you create an execution plan?

925


How to list all triggers in the database with sys.triggers in ms sql server?

1055


Which tcp/ip port does sql server run on? How can it be changed?

1016