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

How do we upgrade from SQL Server 6.5 to 7.0 and 7.0 to 2000?

2051


What are the types of processing and explain each? : sql server analysis services, ssas

1205


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

1107


Explain syntax for dropping triggers?

968


Where is localdb stored?

992


Why do we partition data?

1079


Explain differentiate between a having clause and a where clause?

949


Explain contrast amongst grouped and non-bunched records?

1089


Do you know the policy based administration feature of sql server 2008?

1000


Is sql server implemented as a service or an application? : Sql server database administration

995


How do I find information about the install locations for the various instances running on a computer?

1123


What is a rownum?

1059


I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration

1165


What’s the use of custom fields in report?

986


What are the steps to insert a table?

991