﻿{"id":310,"date":"2014-10-24T10:45:15","date_gmt":"2014-10-24T09:45:15","guid":{"rendered":"http:\/\/www.codereview.co\/?p=310"},"modified":"2014-10-23T09:30:35","modified_gmt":"2014-10-23T08:30:35","slug":"how-do-you-check-collation-and-compatibility-level-for-a-database","status":"publish","type":"post","link":"http:\/\/www.codereview.co\/index.php\/sql-server-tutorials\/how-do-you-check-collation-and-compatibility-level-for-a-database\/","title":{"rendered":"How do you check collation and compatibility level for a database?"},"content":{"rendered":"<p><span style=\"color: #000000;\"><strong>Scenario<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">There is a common practice in the DBA world to work on a daily basis with back-ups and restoring of databases on different servers with different configurations. In an ideal world you would have the same collation and the same compatibility level on all your machines but for cases when this doesn&#8217;t happen here&#8217;s how to get the information you need.\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Solution<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\">The following query can be used to see the collation and compatibility level your databases:<\/span><\/p>\n<p><span style=\"color: #000000;\"><em>SELECT compatibility_level,<\/em><\/span><\/p>\n<p><span style=\"color: #000000;\"><em><strong>collation_name<\/strong><\/em><\/span><\/p>\n<p><span style=\"color: #000000;\"><em>FROM sys.databases<\/em><\/span><\/p>\n<p><span style=\"color: #000000;\"><em>WHERE <strong>name <\/strong>=&#8217;YOUR DATABASE NAME HERE&#8217;<\/em><\/span><\/p>\n<p><span style=\"color: #000000;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Thanks for reading this article,<\/strong><\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>Next steps :<\/strong><\/span><\/p>\n<ol>\n<li><span style=\"color: #000000;\"><b><strong>Add this script to your database toolkit<\/strong><\/b><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Share this with your colleagues because Sharing is Learning<\/strong><\/span><\/li>\n<li><span style=\"color: #000000;\"><strong>Comment below if you need any assistance<\/strong><\/span><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Scenario There is a common practice in the DBA world to work on a daily basis with back-ups and restoring of databases on different servers with different configurations. In an ideal world you would have the same collation and the same compatibility level on all your machines but for cases when this doesn&#8217;t happen here&#8217;s [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,3],"tags":[158,164,8,13,12],"_links":{"self":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/310"}],"collection":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":3,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"predecessor-version":[{"id":390,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/posts\/310\/revisions\/390"}],"wp:attachment":[{"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.codereview.co\/index.php\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}