{"id":551,"date":"2009-09-10T21:53:07","date_gmt":"2009-09-10T21:53:07","guid":{"rendered":"http:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/"},"modified":"2009-09-10T21:53:07","modified_gmt":"2009-09-10T21:53:07","slug":"principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context","status":"publish","type":"post","link":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/","title":{"rendered":"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context."},"content":{"rendered":"<p>Just to remind me because I always forget about it<\/p>\n<p>I was trying to do some maintenance on the SQL database that I use for one of my sites.<\/p>\n<p>I used SQL Management Studio to connect ok but when I tried to expand the database container I got this error (with username and dbname being specific to your site)<\/p>\n<blockquote>\n<p>The server principal &quot;<strong>username<\/strong>&quot; is not able to access the database &quot;<strong>dbname<\/strong>&quot; under the current security context.       <br \/>.Net SqlClient Data Provider in SQL Server Management Studio.<\/p>\n<\/blockquote>\n<p>&#160;<\/p>\n<p>It\u2019s a shared hosting plan so obviously the security is pretty tight but I couldn\u2019t even view my own database <\/p>\n<p>Fortunately the answer is simple (I found the answer on lots of sites <a href=\"http:\/\/www.kf7.co.uk\/sql-server-principal-not-able-access-database.aspx\" class=\"broken_link\">but this the first one i found<\/a> \u2013thanks!)<\/p>\n<blockquote>\n<p><strong>Reason:<\/strong>      <br \/>This is because the MS SQL Server is attempting to execute a T-SQL query to retrieve a list of databases along with additional information about those databases. One of those pieces of information is &quot;Collation&quot;, which you will not have permission to action for all databases as you&#8217;re in a shared hosting environment and you only have access to your database alone.      <\/p>\n<p><strong>Solution:       <br \/><\/strong>Step 1: In Object Explorer, click Databases      <br \/>Step 2: Display Object Explorer Details (F7) or View &gt; Object Explorer Details      <br \/>Step 3: Right click the column headers and de-select &quot;Collation&quot;      <br \/>Step 4: Refresh Databases<\/p>\n<\/blockquote>\n<p>&#160;<\/p>\n<p>Easy enough \u2013 once I\u2019d stopped the collation field from displaying all was well<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just to remind me because I always forget about it I was trying to do some maintenance on the SQL database that I use for one of my sites. I used SQL Management Studio to connect ok but when I tried to expand the database container I got this error (with username and dbname being<\/p>\n<p><a class=\"readmore\" href=\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\"><span class=\"arrow-right icon\"><\/span>Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[97],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.11 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog\" \/>\n<meta property=\"og:description\" content=\"Just to remind me because I always forget about it I was trying to do some maintenance on the SQL database that I use for one of my sites. I used SQL Management Studio to connect ok but when I tried to expand the database container I got this error (with username and dbname beingRead More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\" \/>\n<meta property=\"og:site_name\" content=\"Andy&#039;s Techie Blog\" \/>\n<meta property=\"article:published_time\" content=\"2009-09-10T21:53:07+00:00\" \/>\n<meta name=\"author\" content=\"Andy Parkes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andy Parkes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\",\"url\":\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\",\"name\":\"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog\",\"isPartOf\":{\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/#website\"},\"datePublished\":\"2009-09-10T21:53:07+00:00\",\"dateModified\":\"2009-09-10T21:53:07+00:00\",\"author\":{\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/3534e8ac6b1bec765cd061feff56679d\"},\"breadcrumb\":{\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/andyparkes.co.uk\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/#website\",\"url\":\"https:\/\/andyparkes.co.uk\/blog\/\",\"name\":\"Andy&#039;s Techie Blog\",\"description\":\"Professional Geek\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/andyparkes.co.uk\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/3534e8ac6b1bec765cd061feff56679d\",\"name\":\"Andy Parkes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3824cbf53df51d7ca5cf809b6ad81a157fbfff2292e36ab8666f04ddad06bfcc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3824cbf53df51d7ca5cf809b6ad81a157fbfff2292e36ab8666f04ddad06bfcc?s=96&d=mm&r=g\",\"caption\":\"Andy Parkes\"},\"description\":\"Andy Parkes is Technical Director at Coventry based IT support company IBIT Solutions. Formerly, coordinator of AMITPRO and Microsoft Partner Area Lead for 2012-2013. He also isn't a fan of describing himself in the third person.\",\"sameAs\":[\"http:\/\/www.andyparkes.co.uk\/blog\"],\"url\":\"https:\/\/andyparkes.co.uk\/blog\/index.php\/author\/andyparkes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/","og_locale":"en_US","og_type":"article","og_title":"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog","og_description":"Just to remind me because I always forget about it I was trying to do some maintenance on the SQL database that I use for one of my sites. I used SQL Management Studio to connect ok but when I tried to expand the database container I got this error (with username and dbname beingRead More","og_url":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/","og_site_name":"Andy&#039;s Techie Blog","article_published_time":"2009-09-10T21:53:07+00:00","author":"Andy Parkes","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Andy Parkes","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/","url":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/","name":"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context. - Andy&#039;s Techie Blog","isPartOf":{"@id":"https:\/\/andyparkes.co.uk\/blog\/#website"},"datePublished":"2009-09-10T21:53:07+00:00","dateModified":"2009-09-10T21:53:07+00:00","author":{"@id":"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/3534e8ac6b1bec765cd061feff56679d"},"breadcrumb":{"@id":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/andyparkes.co.uk\/blog\/index.php\/2009\/09\/10\/principal-username-is-not-able-to-access-the-database-db-under-the-current-security-context\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/andyparkes.co.uk\/blog\/"},{"@type":"ListItem","position":2,"name":"Principal &quot;username&quot; is not able to access the database &quot;db&quot; under the current security context."}]},{"@type":"WebSite","@id":"https:\/\/andyparkes.co.uk\/blog\/#website","url":"https:\/\/andyparkes.co.uk\/blog\/","name":"Andy&#039;s Techie Blog","description":"Professional Geek","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/andyparkes.co.uk\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/3534e8ac6b1bec765cd061feff56679d","name":"Andy Parkes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/andyparkes.co.uk\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3824cbf53df51d7ca5cf809b6ad81a157fbfff2292e36ab8666f04ddad06bfcc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3824cbf53df51d7ca5cf809b6ad81a157fbfff2292e36ab8666f04ddad06bfcc?s=96&d=mm&r=g","caption":"Andy Parkes"},"description":"Andy Parkes is Technical Director at Coventry based IT support company IBIT Solutions. Formerly, coordinator of AMITPRO and Microsoft Partner Area Lead for 2012-2013. He also isn't a fan of describing himself in the third person.","sameAs":["http:\/\/www.andyparkes.co.uk\/blog"],"url":"https:\/\/andyparkes.co.uk\/blog\/index.php\/author\/andyparkes\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pmvJ6-8T","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":0,"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"wp:attachment":[{"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andyparkes.co.uk\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}