Sql-server – SQL Server 2005 collation issues

sqlsql serversql-server-2005

I've got a SQL Server 2005 database that has been built using a different collation from the one one our servers. I'm getting this error whenever I try and run the site:

Exception message: Cannot resolve the
collation conflict between
"Latin1_General_CI_AS" and
"SQL_Latin1_General_CP1_CI_AS" in the
equal to operation

Does anyone know of anyway I can fix the error without having to rebuild the database?

Best Answer

If the problem is a query and you have not the option to rebuild that database, you could go with the COLLATE keyword, for example:

 SELECT *
 FROM OtherServer.xyz.dbo.Table2 t2
     inner join myTable t1 
         on t1.name = t2.name COLLATE SQL_Latin1_General_CP1_CI_AS

Here is the MSDN documentation for COLLATE.