Mark A Matte
markamatte at hotmail.com
Wed Mar 19 15:41:22 CDT 2008
Unfortunately the data comes in with dups...I have the final table indexed...I just have to clean it before inserting. Just looking at different approaches. Thanks, Mark A. Matte > Date: Wed, 19 Mar 2008 15:22:13 -0500 > To: dba-sqlserver at databaseadvisors.com > From: robert at webedb.com > Subject: Re: [dba-SQLServer] Duplicate records > > Mark, > > As other have said, cursors are slow. > > After you get it cleaned up, I would put a unique index on the 2 columns > so that the problem is solved permanently. > > Robert > > At 09:21 AM 3/19/2008, you wrote: >>Date: Tue, 18 Mar 2008 20:46:01 +0000 >>From: Mark A Matte >>Subject: [dba-SQLServer] Duplicate records >>To: Discussion concerning MS SQL Server >> >>Message-ID: >>Content-Type: text/plain; charset="iso-8859-1" >> >> >>Hello All, >> >>I have a large table that occasionally duplicates make it into. The >>2 fields that make the record unique are Case_ID and >>Note_Seq_Nbr. The duplicates are identical...so I have no primary >>key. I used the code below. It doesn't run very fast...but it does >>the job of removing just the extra records... >> >>Any thoughts,comments, or suggestions on making it >>faster/better...or a totally different approach? >> >>Thanks, >> >>Mark A. Matte > > > _______________________________________________ > dba-SQLServer mailing list > dba-SQLServer at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/dba-sqlserver > http://www.databaseadvisors.com > _________________________________________________________________ Climb to the top of the charts! Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan