with x as (select *,rn = row_number()
over(PARTITION BY OrderNo,item order by OrderNo)
from #temp1)
select * from x
where rn > 1
puede eliminar duplicados reemplazando la instrucción select por
delete x where rn > 1