dbTalk Databases Forums  

fastest way to deduplicate a list

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss fastest way to deduplicate a list in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Michael Evanchik
 
Posts: n/a

Default fastest way to deduplicate a list - 10-20-2007 , 11:10 PM






Im trying to dedupe a table with only one field on it. The table has
40 million records in it. What is the fastest way?

1) create a table with a unque constraint on it insert into that
table?

2) create a table without a unique constraint on it and use insert
into table select distinct un from table2?

3) another way?

Michael


Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: fastest way to deduplicate a list - 10-21-2007 , 04:10 AM






Michael Evanchik (mre224 (AT) yahoo (DOT) com) writes:
Quote:
Im trying to dedupe a table with only one field on it. The table has
40 million records in it. What is the fastest way?

1) create a table with a unque constraint on it insert into that
table?
I assume that you would use the IGNORE_DUP_KEY option? Else the scheme
wouldn't work. That could very well be the fastest method.



--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.