Connection and Historico_ligacao
I have a script that copies all data from table Ligacao
to Historico_ligacao
.
When comparing the data between the tebalas, the historico_ligacao
table is ordered differently than Ligacao
, I do not know if it influences anything, but I would like the ordering of both to be equal.
Below is the insert code:
SET IDENTITY_INSERT HISTORICO_LIGACAO ON
INSERT HISTORICO_LIGACAO (CDLIGACAO,CDLOTE,CDATRIBUTOLOTE,CDCAMPANHA,CDROTA,CDCONTATO,CDTELEFONE,CDESTADOLIGACAO,DURACAO,DTINICIO,DTFINAL,NUMERO_DISCADO,TECLAS_VALIDAS,TECLAS_TODAS, timezone)
output inserted.CDLIGACAO into #temp (num)
SELECT * FROM LIGACAO WHERE CDLOTE <= @CDLOTE order by cdligacao;
SET IDENTITY_INSERT HISTORICO_LIGACAO OFF