Error al hacer consultas con dos bases de datos: Cannot resolve the collation conflict

publicado por: Anonymous

Cómo puedo solucionar el error:

Cannot resolve the collation conflict between “SQL_Latin1_General_CP1_CI_AS” and “SQL_Latin1_General_CP850_CI_AS” in the equal to operation.

Consulta:

SELECT T3.ItemCode,T3.ItemName,  sum(Convert(int,A.VPiezas)) as Cantidad, 
sum(Convert(money, (A.VPiezas)))/sum(Convert(money,(A.VPiezas))) as PrecioU 
FROM OITM T0
INNER JOIN OITT T1 ON T0.[ItemCode] = T1.[Code] 
INNER JOIN ITT1 T2 ON T1.[Code] = T2.[Father] 
INNER JOIN OITM T3 ON T2.[Code] = T3.[ItemCode] 
INNER JOIN [Ventas_catavina].dbo.SVenta A ON T3.ItemCode = Codigo1   
WHERE T0.TreeType = 'T' and T3.ItmsGrpCod in (111)
group by T3.ItemCode, T3.ItemName

solución

Intentalo de esta manera:

SELECT T3.ItemCode,T3.ItemName,  sum(Convert(int,A.VPiezas)) as Cantidad, 
sum(Convert(money, (A.VPiezas)))/sum(Convert(money,(A.VPiezas))) as PrecioU 
FROM OITM T0
INNER JOIN OITT T1 ON T0.[ItemCode] = T1.[Code] 
INNER JOIN ITT1 T2 ON T1.[Code] = T2.[Father] 
INNER JOIN OITM T3 ON T2.[Code] = T3.[ItemCode] 
INNER JOIN [Ventas_catavina].dbo.SVenta A ON T3.ItemCode = Codigo1   
COLLATE SQL_Latin1_General_CP850_CI_AS
WHERE T0.TreeType = 'T' and T3.ItmsGrpCod in (111)
group by T3.ItemCode, T3.ItemName
Respondido por: Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *