Problem

Error messages like this found in the log file:
{code:java}
com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve collation conflict between "SQL_Latin1_General_CP437_CI_AI" and "Latin1_General_CI_AI" in CASE operator occurring in SELECT statement column 5.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:256)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:592)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:522)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194)
(...){code}
 

This issue results from having two different collation configuration values in your database, and this needs to be fixed.

Collations are used when ordering and comparing strings, and it is important to have a single, unique collation used throughout the database, since ordering and comparing string values will fail if the collation is different.


Solution

The solution is to change the database or tables to have a single collation. If necessary contact your database vendor for the best approach to fix this.