% w / o% down is causing a lot of slowness because I use
Right(L.nrDiscado, Len(D.Descricao))
(I believe) to compare with the SQL
field:
create table #TempNrDiscado (NrDiscado varchar(150))
Insert into #TempNrDiscado
Select distinct L.nrDiscado from #TempLigacoes L with(nolock)
inner join GI_Dispositivo D with(nolock) on
Right(L.nrDiscado, Len(D.Descricao)) = D.Descricao
Does anyone know of any way I could make this comparison?
Note: If I put a number 10 in place of D.Descricao
it goes fast .