Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Duplicate Records

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-25 : 01:48:22
Chris Pennington writes "I am trying to get rid of duplicate records ina SQL database, however I am fairly new to SQL Server. I found a resource that said to do the following:

BEGIN TRAN
select distinct * into #dup from interactiontrack
delete interactiontrack

insert interactiontrack select * from #dup
COMMIT TRAN

InteractionTrack is the name of my table with the duplicates, however I don't know the function of #dup - Id this a table that i need to create. if I run the query, I get a message box telling me that x number of records were affected, however if i run:

SELECT * from interaction track order by interactionid, there are still dupes in the dB.

Heeeeeeeeeeeeeeeelp!!!!

PS We are talking THOUSANDS of records that have been duplicated!

Thanks in advance....

CHRIS PENNINGTON"
   

- Advertisement -