Не могу вспомнить, где я его взял, но я использовал этот SQL для удаления дубликатов из таблицы:
begin tran deduplicate
select DISTINCT *
into #temp
from mytable
truncate table mytable
insert mytable
select *
from #temp
select * from mytable
drop table #temp
commit tran deduplicate