{"id":379,"date":"2012-01-10T02:02:38","date_gmt":"2012-01-09T21:02:38","guid":{"rendered":"http:\/\/kennywu.info\/?p=379"},"modified":"2012-01-10T02:03:25","modified_gmt":"2012-01-09T21:03:25","slug":"how-to-change-sql-server-to-be-case-sensitive","status":"publish","type":"post","link":"http:\/\/kennywu.info\/?p=379","title":{"rendered":"How to change SQL Server to be case sensitive"},"content":{"rendered":"<p>The default COLLATE in SQL Server is &#8220;Latin1_GENERAL_CI_AS&#8221;, which means it&#8217;s Case Insensitive and Accent Sensitive. There are cases that you want to be case sensitive while doing a join, compare a value etc. There two ways to accomplish it.<\/p>\n<ul>\n<li><code>ALTER DATABASE database_name COLLATE Latin1_GENERAL_CS_AS<\/code><br \/>\nIt will change the whole db to this collate. Need to back the db and all that.<\/li>\n<li><code>AA left join BB  on AA.Fobkey = BB.Fobkey COLLATE Latin1_GENERAL_CS_AS<\/code><br \/>\nThe collate only apply to this operation. There are cases that you have no control of the collate of the whole database, then it&#8217;s the only option you have.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The default COLLATE in SQL Server is &#8220;Latin1_GENERAL_CI_AS&#8221;, which means it&#8217;s Case Insensitive and Accent Sensitive. There are cases that you want to be case sensitive while doing a join, compare a value etc. There two ways to accomplish it. &hellip; <a href=\"http:\/\/kennywu.info\/?p=379\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[80],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-database","tag-collate"],"_links":{"self":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=379"}],"version-history":[{"count":4,"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":383,"href":"http:\/\/kennywu.info\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions\/383"}],"wp:attachment":[{"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kennywu.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}