Today I was trying to join two fields from different tables. One of the table in the query was from a linked sql server with a different collation. As such when runing this comparision I was getting the error Cannot resolve the collation conflict between “Latin1_General_BIN” and “Latin1_General_CI_AS” in the equal to operation. I am sure many of us would have got this error from time to time. The way I resolved this was simple. Use collate database_default in the comparision statement.
Hence you statement will look like this:
Select * From table1, table2
Where x = y
AND (table1.departmentid = left(table2.dept,2) collate database_default)
September 16, 2009 at 3:37 pm
Thank you for posting. I used it in my query and it worked great.
October 9, 2009 at 9:58 am
THANK YOU!
Great post which solved my problem
October 9, 2009 at 6:45 pm
I don’t usually reply to posts but I will in this case, great info…I will add a backlink and bookmark your site. Keep up the good work!
December 16, 2009 at 3:35 pm
select * from dbo.TempCh where [customer name] like ‘上海精元机械有限公司’ collate Chinese_PRC_CI_AI_KS_WS
I am facing issue while comparision