{"id":91,"date":"2011-08-17T20:16:00","date_gmt":"2011-08-18T01:16:00","guid":{"rendered":"https:\/\/www.chrystalsander.com\/blog\/?p=91"},"modified":"2023-07-26T12:19:32","modified_gmt":"2023-07-26T17:19:32","slug":"error-cannot-resolve-the-collation-conflict","status":"publish","type":"post","link":"https:\/\/www.chrystalsander.com\/blog\/?p=91","title":{"rendered":"Error:  Cannot resolve the collation conflict"},"content":{"rendered":"<p>This error started occurring after one of my <span>SQL<\/span> Server 2008 databases had been restored:<\/p>\n<p><span style=\"font-family:courier new;color:#009900;\"><span>Msg<\/span> 468, Level 16, State 9 &#8230;<br \/>\n<br \/>Cannot resolve the collation conflict between &#8220;<span>SQL<\/span>_Latin1_General_<span>CP<\/span>1_CI_AS&#8221; and &#8220;<span>SQL<\/span>_Latin1_General_<span>CP<\/span>1_CS_AS&#8221; in the equal to operation.<br \/>\n<br \/><\/span><br \/>\n<br \/>Supposedly, this type of error can <span>occur when<\/span> the <span>tempdb<\/span> collation does not match the current database collation &#8212; especially if using temp tables.<\/p>\n<p>The easiest way to deal with this is to cast one of the field&#8217;s collation so it matches the other, or you can cast both if you need. I&#8217;m not sure if this is best practice in the long run; however, if you&#8217;re just doing some ad-<span>hoc<\/span> data mining then this is <span>definitely<\/span> a quick fix:<\/p>\n<p><span style=\"font-family:courier new;color:#009900;\">INNER JOIN [TABLE1].FIELD1 AS EA<br \/>\n<br \/>ON EA.SERIAL_<span>NBR<\/span> <span style=\"color:#cc0000;\">COLLATE database_default<\/span> = E.SERIAL_<span>NBR<\/span> <span style=\"color:#ff0000;\">COLLATE database_default<\/span><\/span><span style=\"color:#ff0000;\"> <\/span><br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This error started occurring after one of my SQL Server 2008 databases had been restored: Msg 468, Level 16, State 9 &#8230; Cannot resolve the collation conflict between &#8220;SQL_Latin1_General_CP1_CI_AS&#8221; and &#8220;SQL_Latin1_General_CP1_CS_AS&#8221; in the equal to operation. Supposedly, this type of error can occur when the tempdb collation does not match the current database collation &#8212; &hellip; <a href=\"https:\/\/www.chrystalsander.com\/blog\/?p=91\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Error:  Cannot resolve the collation conflict&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[49],"_links":{"self":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91"}],"collection":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":1,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/172"}],"wp:attachment":[{"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chrystalsander.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}