{"id":2235,"date":"2014-03-10T11:00:04","date_gmt":"2014-03-10T15:00:04","guid":{"rendered":"http:\/\/sqlity.net\/en\/?p=2235"},"modified":"2014-11-13T13:11:36","modified_gmt":"2014-11-13T18:11:36","slug":"implicit-user-error","status":"publish","type":"post","link":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/","title":{"rendered":"An implicit user creation has failed."},"content":{"rendered":"<div>\n<h3>Introduction<\/h3>\n<p>\nSQL Server, in some situations automatically creates a user in a database. When that implicit user creation fails, you will get an error that might catch you off guard.\n<\/p>\n<h3>Implicit User Creation Failure<\/h3>\n<p>\nFor this example, we need to first create an orphan user and a login with the same name:\n<\/p>\n<div>\n[sql]\nCREATE LOGIN TestLogin1 WITH PASSWORD='********',CHECK_POLICY=OFF;<br \/>\nCREATE USER TestLogin1 FOR LOGIN TestLogin1;<br \/>\nDROP LOGIN TestLogin1;<br \/>\nCREATE LOGIN TestLogin1 WITH PASSWORD='********',CHECK_POLICY=OFF;<br \/>\n[\/sql]\n<\/div>\n<p>\nThis creates a login and an associated user. Right after the user is created, the login is dropped and recreated. With that, we now have a login and a user with the same name that are not associated with each other.\n<\/p>\n<p>\nNow we can grant <span class=\"tt\">CONTROL SERVER<\/span> to <span class=\"tt\">TestLogin1<\/span> and then have <span class=\"tt\">TestLogin1<\/span> create a schema. As we have seen in <a href=\" http:\/\/sqlity.net\/en\/2218\/cs-sa-creating-schemata\/\">CONTROL SERVER vs. sysadmin - Differences when Creating a Schema<\/a>, this will cause SQL Server to try to create a new user for the login, as no associated user exists. However, that attempt fails, as there is already a user with that name:\n<\/p>\n<p>\n<a href=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg\" alt=\"An implicit user creation has failed.\" title=\"An implicit user creation has failed.\" width=\"887\" height=\"464\" class=\"aligncenter size-full wp-image-2236\" srcset=\"https:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg 887w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed-300x156.jpg 300w, https:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed-150x78.jpg 150w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/a>\n<\/p>\n<p>\nThe exact error message is:\n<\/p>\n<div>\n[sourcecode]\nMsg 15145, Level 16, State 1, Line 1<br \/>\nAn implicit user creation has failed. Reason: The user may have been dropped or its name may already be in use.<br \/>\nMsg 2759, Level 16, State 0, Line 1<br \/>\nCREATE SCHEMA failed due to previous errors.<br \/>\n[\/sourcecode]\n<\/div>\n<p>\nThis error message you can encounter in several situations. Usually it happens when you least expect it. The most likely cause is that SQL Server is trying to implicitly create a user but fails because the user name is in use already.\n<\/p>\n<h3>Summary<\/h3>\n<p>\nIn a few situations, SQL Server is creating users automatically. Usually that action happens unnoticed. However, when it fails it causes an error to be raised. That error is usually surprising. However, if you know what causes it, it is easy to fix.\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The error message &#8220;An implicit user creation has failed.&#8221; indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.<\/p>\n<p> <a href=\"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/\">[more&#8230;]<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"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":[5,34,99],"tags":[59,125,38,58,15],"class_list":["post-2235","post","type-post","status-publish","format-standard","hentry","category-general","category-security","category-security-pitfalls","tag-database-principals","tag-owner","tag-security-2","tag-security-management","tag-sql-server"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>An implicit user creation has failed. - sqlity.net<\/title>\n<meta name=\"description\" content=\"&quot;An implicit user creation has failed.&quot; indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"An implicit user creation has failed. - sqlity.net\" \/>\n<meta property=\"og:description\" content=\"&quot;An implicit user creation has failed.&quot; indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/\" \/>\n<meta property=\"og:site_name\" content=\"sqlity.net\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sqlity.net\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-10T15:00:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-11-13T18:11:36+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg\" \/>\n<meta name=\"author\" content=\"Sebastian Meine\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@sqlity\" \/>\n<meta name=\"twitter:site\" content=\"@sqlity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sebastian Meine\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/\"},\"author\":{\"name\":\"Sebastian Meine\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"headline\":\"An implicit user creation has failed.\",\"datePublished\":\"2014-03-10T15:00:04+00:00\",\"dateModified\":\"2014-11-13T18:11:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/\"},\"wordCount\":328,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/03\\\/An_implicit_user_creation_has_failed.jpg\",\"keywords\":[\"database principals\",\"owner\",\"security\",\"security management\",\"SQL Server\"],\"articleSection\":[\"General\",\"Security\",\"Security Pitfalls\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/\",\"name\":\"An implicit user creation has failed. - sqlity.net\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/03\\\/An_implicit_user_creation_has_failed.jpg\",\"datePublished\":\"2014-03-10T15:00:04+00:00\",\"dateModified\":\"2014-11-13T18:11:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\"},\"description\":\"\\\"An implicit user creation has failed.\\\" indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#primaryimage\",\"url\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/03\\\/An_implicit_user_creation_has_failed.jpg\",\"contentUrl\":\"http:\\\/\\\/sqlity.net\\\/wp-content\\\/uploads\\\/2014\\\/03\\\/An_implicit_user_creation_has_failed.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/2235\\\/implicit-user-error\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"An implicit user creation has failed.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/sqlity.net\\\/en\\\/\",\"name\":\"sqlity.net\",\"description\":\"Quality for SQL\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sqlity.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sqlity.net\\\/en\\\/#\\\/schema\\\/person\\\/bcffd8c572bc2f1bd10fdba80135e53c\",\"name\":\"Sebastian Meine\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g\",\"caption\":\"Sebastian Meine\"},\"sameAs\":[\"http:\\\/\\\/sqlity.net\",\"https:\\\/\\\/x.com\\\/sqlity\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"An implicit user creation has failed. - sqlity.net","description":"\"An implicit user creation has failed.\" indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.","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:\/\/sqlity.net\/en\/2235\/implicit-user-error\/","og_locale":"en_US","og_type":"article","og_title":"An implicit user creation has failed. - sqlity.net","og_description":"\"An implicit user creation has failed.\" indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.","og_url":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/","og_site_name":"sqlity.net","article_publisher":"https:\/\/www.facebook.com\/sqlity.net","article_published_time":"2014-03-10T15:00:04+00:00","article_modified_time":"2014-11-13T18:11:36+00:00","og_image":[{"url":"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg","type":"","width":"","height":""}],"author":"Sebastian Meine","twitter_card":"summary_large_image","twitter_creator":"@sqlity","twitter_site":"@sqlity","twitter_misc":{"Written by":"Sebastian Meine","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#article","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/"},"author":{"name":"Sebastian Meine","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"headline":"An implicit user creation has failed.","datePublished":"2014-03-10T15:00:04+00:00","dateModified":"2014-11-13T18:11:36+00:00","mainEntityOfPage":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/"},"wordCount":328,"commentCount":0,"image":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg","keywords":["database principals","owner","security","security management","SQL Server"],"articleSection":["General","Security","Security Pitfalls"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/","url":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/","name":"An implicit user creation has failed. - sqlity.net","isPartOf":{"@id":"https:\/\/sqlity.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#primaryimage"},"image":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#primaryimage"},"thumbnailUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg","datePublished":"2014-03-10T15:00:04+00:00","dateModified":"2014-11-13T18:11:36+00:00","author":{"@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c"},"description":"\"An implicit user creation has failed.\" indicates that SQL Server tried to create a user automatically and failed. Read on to see when and why this happens.","breadcrumb":{"@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#primaryimage","url":"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg","contentUrl":"http:\/\/sqlity.net\/wp-content\/uploads\/2014\/03\/An_implicit_user_creation_has_failed.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/sqlity.net\/en\/2235\/implicit-user-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sqlity.net\/en\/"},{"@type":"ListItem","position":2,"name":"An implicit user creation has failed."}]},{"@type":"WebSite","@id":"https:\/\/sqlity.net\/en\/#website","url":"https:\/\/sqlity.net\/en\/","name":"sqlity.net","description":"Quality for SQL","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sqlity.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/sqlity.net\/en\/#\/schema\/person\/bcffd8c572bc2f1bd10fdba80135e53c","name":"Sebastian Meine","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ab0a6d02dd494849a584a2c3c8bc3bdcef1d0aa5f87e98bf905dbdb9ad2ce3a?s=96&d=mm&r=g","caption":"Sebastian Meine"},"sameAs":["http:\/\/sqlity.net","https:\/\/x.com\/sqlity"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2wXuw-A3","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/comments?post=2235"}],"version-history":[{"count":0,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/posts\/2235\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/media?parent=2235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/categories?post=2235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlity.net\/en\/wp-json\/wp\/v2\/tags?post=2235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}