{"id":1530,"date":"2018-01-01T13:13:36","date_gmt":"2018-01-01T13:13:36","guid":{"rendered":"http:\/\/www.theSQLReport.com\/?p=1530"},"modified":"2018-01-01T13:13:36","modified_gmt":"2018-01-01T13:13:36","slug":"alter-login-with-password-causes-error-msg-15151-level-16-state-1-line-4","status":"publish","type":"post","link":"http:\/\/www.theSQLReport.com\/?p=1530","title":{"rendered":"ALTER LOGIN WITH PASSWORD causes error Msg 15151, Level 16, State 1, Line 4"},"content":{"rendered":"<p><strong>Problem:<\/strong><\/p>\n<p>A user that was not part of the sysadmin role attempted to change its own password using the SQL syntax, &#8220;ALTER LOGIN WITH PASSWORD&#8221;.<\/p>\n<p>Returned is the following error:<\/p>\n<p><em>Msg 15151, Level 16, State 1, Line 4<\/em><\/p>\n<p><em>Cannot alter the login &#8216;\u00a0 &lt; username &gt; &#8216;, because it does not exist or you do not have permission.<\/em><\/p>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/AlterLoginWithPassswordFails.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1531 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/AlterLoginWithPassswordFails.jpg\" alt=\"Alter Login With Passsword Fails\" width=\"928\" height=\"322\" \/><\/a><\/p>\n<p><strong>Resolution:<\/strong><\/p>\n<p>The user was able to change its own password using the stored procedure sp_password, however it must provide the old password for the statement to complete successfully.<\/p>\n<pre>SP_PASSWORD @OLD = ' &lt; old password &gt; ', @NEW = ' &lt; new password &gt; ';\r\nGO<\/pre>\n<p><a href=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1532 size-full\" src=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS.jpg\" alt=\"SP_PASSWORD SUCCESS\" width=\"974\" height=\"269\" srcset=\"http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS.jpg 974w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS-300x83.jpg 300w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS-768x212.jpg 768w, http:\/\/www.theSQLReport.com\/wp-content\/uploads\/2017\/12\/SP_PASSWORD_SUCCESS-210x58.jpg 210w\" sizes=\"(max-width: 974px) 100vw, 974px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: A user that was not part of the sysadmin role attempted to change its own password using the SQL syntax, &#8220;ALTER LOGIN WITH PASSWORD&#8221;. Returned is the following error: &hellip; <a class=\"readmore\" href=\"http:\/\/www.theSQLReport.com\/?p=1530\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":1531,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[122,121,120],"class_list":["post-1530","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql-server","tag-alter-login-with-password","tag-msg-15151","tag-sp_password"],"_links":{"self":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1530"}],"collection":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1530"}],"version-history":[{"count":6,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1530\/revisions"}],"predecessor-version":[{"id":1538,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/posts\/1530\/revisions\/1538"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=\/wp\/v2\/media\/1531"}],"wp:attachment":[{"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1530"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.theSQLReport.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}