-1
Someone can help with this Union of tables with Collates, I searched in Google and did not understand very well.
error : Cannot resolve the collation Conflict between "Sql_latin1_general_cp850_ci_ai" and "Sql_latin1_general_cp850_ci_as" in the UNION Operation.
Select MAX(SERV_DH_ULTIMAATU) AS RECEBIMENTO ,EMPR_DS_EMPRESA, DATEDIFF(MI, MAX(SERV_DH_ULTIMAEXEC), GETDATE()) AS PERIODO
from A1.DBO.CS_CDTB_SERVICO_SERV SERV (NOLOCK)
INNER JOIN A1.DBO.CS_CDTB_EMPRESA_EMPR EMPR ON
EMPR.ID_EMPR_CD_EMPRESA = SERV.ID_EMPR_CD_EMPRESA
where SERV_DS_SERVICO LIKE '%AGENTE DO CLASSIFICADOR DE EMAIL%'
AND EMPR.EMPR_IN_INATIVO = 'N'AND EMPR.EMPR_DS_EMPRESA NOT LIKE '%(NÃO USAR)%'
GROUP BY EMPR_DS_EMPRESA union
Select MAX(SERV_DH_ULTIMAATU) AS RECEBIMENTO ,EMPR_DS_EMPRESA, DATEDIFF(MI, MAX(SERV_DH_ULTIMAEXEC), GETDATE()) AS PERIODO
from A2.DBO.CS_CDTB_SERVICO_SERV SERV (NOLOCK)
INNER JOIN A2.DBO.CS_CDTB_EMPRESA_EMPR EMPR ON
EMPR.ID_EMPR_CD_EMPRESA = SERV.ID_EMPR_CD_EMPRESA
where SERV_DS_SERVICO LIKE '%AGENTE DO CLASSIFICADOR DE EMAIL%'
AND EMPR.EMPR_IN_INATIVO = 'N'AND EMPR.EMPR_DS_EMPRESA NOT LIKE '%(NÃO USAR)%'
GROUP BY EMPR_DS_EMPRESA