{"id":124,"date":"2009-12-31T12:16:58","date_gmt":"2009-12-31T12:16:58","guid":{"rendered":"http:\/\/blog.rabihtawil.com\/?p=124"},"modified":"2010-07-22T13:35:19","modified_gmt":"2010-07-22T13:35:19","slug":"how-to-change-the-sa-password-in-sql-server-20052008","status":"publish","type":"post","link":"http:\/\/www.raytawil.com\/?p=124","title":{"rendered":"How to Change the \u2018sa\u2019 password in SQL Server 2005,2008"},"content":{"rendered":"<h1 style=\"text-align: justify;\"><span style=\"color: #ff0000;\"><span style=\"text-decoration: underline;\"><strong>Method 1:<\/strong><\/span><\/span><\/h1>\n<p><\/br><\/p>\n<p style=\"text-align: justify;\">\n<p style=\"text-align: justify;\">Login into SQL Server using Windows Authentication.<\/p>\n<p style=\"text-align: justify;\">In Object Explorer, open Security folder, open Logins folder. Right Click on SA account and go to Properties.<\/p>\n<p style=\"text-align: justify;\"><a rel=\"attachment wp-att-125\" href=\"http:\/\/www.raytawil.com\/?attachment_id=125\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-125\" title=\"sapass1\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass1.gif\" alt=\"sapass1\" width=\"400\" height=\"400\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">Change SA password, and confirm it. Click OK.<\/p>\n<p style=\"text-align: justify;\"><a rel=\"attachment wp-att-126\" href=\"http:\/\/www.raytawil.com\/?attachment_id=126\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-126\" title=\"sapass2\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass2.gif\" alt=\"sapass2\" width=\"500\" height=\"447\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\n<p style=\"text-align: justify;\">Make sure to restart the SQL Server and all its services and test new password by log into system using SA login and new password.<\/p>\n<h1 style=\"text-align: justify;\"><span style=\"color: #ff0000;\"><span style=\"text-decoration: underline;\"><strong>Method 2:<\/strong><\/span><\/span><\/h1>\n<p><\/br><br \/>\n1.Open the SQL Server express management studio<br \/>\n2.Connect to SQL Server using windows authentication<\/p>\n<p><a rel=\"attachment wp-att-125\" href=\"http:\/\/www.raytawil.com\/?attachment_id=125\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-125\" title=\"sapass1\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass1.gif\" alt=\"sapass1\" width=\"400\" height=\"400\" \/><\/a><br \/>\n3.Right click the server name and choose properties<\/p>\n<p><a rel=\"attachment wp-att-127\" href=\"http:\/\/www.raytawil.com\/?attachment_id=127\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-127\" title=\"sapass3\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass3.png\" alt=\"sapass3\" width=\"487\" height=\"518\" \/><\/a><br \/>\n4.Go to security tab. Change server authentication to \u201cSQL Server and Windows Authentication mode\u201d<\/p>\n<p><a rel=\"attachment wp-att-128\" href=\"http:\/\/www.raytawil.com\/?attachment_id=128\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-128\" title=\"sapass4\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass4.png\" alt=\"sapass4\" width=\"704\" height=\"632\" \/><\/a><br \/>\n5.Click OK and restart SQL Server<br \/>\n6.Go to SQL Server studio management express<br \/>\n7.Expand the server and choose security and expand logins<\/p>\n<p><a rel=\"attachment wp-att-125\" href=\"http:\/\/www.raytawil.com\/?attachment_id=125\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-125\" title=\"sapass1\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass1.gif\" alt=\"sapass1\" width=\"400\" height=\"400\" \/><\/a><br \/>\n8.Right click on SA, from properties modify the password and confirm password<\/p>\n<p><a rel=\"attachment wp-att-126\" href=\"http:\/\/www.raytawil.com\/?attachment_id=126\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-126\" title=\"sapass2\" src=\"http:\/\/blog.rabihtawil.com\/wp-content\/uploads\/2009\/12\/sapass2.gif\" alt=\"sapass2\" width=\"500\" height=\"447\" \/><\/a><\/p>\n<h1><span style=\"color: #ff0000;\"><span style=\"text-decoration: underline;\"><strong>Method 3: (From Command prompt)<\/strong><\/span><\/span><\/h1>\n<p><\/br><br \/>\n1. Start a command prompt by\u00a0typing <em>Start<\/em> \u2013 <em>Run<\/em> \u2013 <em>cmd<\/em><\/p>\n<p>2. Enter the following commands, pressing Enter after each line<\/p>\n<p><em>OSQL -S\u00a0yourservername -E<\/em><br \/>\n1&gt; <em>EXEC sp_password NULL, \u2018yourpassword\u2019, \u2019sa\u2019<br \/>\n<\/em> 2&gt; <em>GO<\/em><\/p>\n<p>Where yourservername is the name of your server and yourpassword is the new sa account password.\u00a0 Type <em>exit<\/em> twice to return to the server desktop.<\/p>\n<h1><span style=\"color: #ff0000;\"><span style=\"text-decoration: underline;\"><strong>Method 4: (Query) my personal favorite<\/strong><\/span><\/span><\/h1>\n<p><\/br><br \/>\nMake a new query &amp; write in it, then run.<\/p>\n<div id=\"wpshdo_1\" class=\"wp-synhighlighter-outer\"><div id=\"wpshdt_1\" class=\"wp-synhighlighter-expanded\"><table border=\"0\" width=\"100%\"><tr><td align=\"left\" width=\"80%\"><a name=\"#codesyntax_1\"><\/a><a id=\"wpshat_1\" class=\"wp-synhighlighter-title\" href=\"#codesyntax_1\"  onClick=\"javascript:wpsh_toggleBlock(1)\" title=\"Click to show\/hide code block\">Source code<\/a><\/td><td align=\"right\"><a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_code(1)\" title=\"Show code only\"><img border=\"0\" style=\"border: 0 none\" src=\"http:\/\/www.raytawil.com\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/code.png\" \/><\/a>&nbsp;<a href=\"#codesyntax_1\" onClick=\"javascript:wpsh_print(1)\" title=\"Print code\"><img border=\"0\" style=\"border: 0 none\" src=\"http:\/\/www.raytawil.com\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/printer.png\" \/><\/a>&nbsp;<a href=\"http:\/\/www.raytawil.com\/wp-content\/plugins\/wp-synhighlight\/About.html\" target=\"_blank\" title=\"Show plugin information\"><img border=\"0\" style=\"border: 0 none\" src=\"http:\/\/www.raytawil.com\/wp-content\/plugins\/wp-synhighlight\/themes\/default\/images\/info.gif\" \/><\/a>&nbsp;<\/td><\/tr><\/table><\/div><div id=\"wpshdi_1\" class=\"wp-synhighlighter-inner\" style=\"display: block;\"><pre class=\"sql\" style=\"font-family:monospace;\"><span class=\"kw1\">USE<\/span> <span class=\"br0\">[<\/span>master<span class=\"br0\">]<\/span>\n GO\n <span class=\"kw1\">ALTER<\/span> LOGIN <span class=\"br0\">[<\/span>sa<span class=\"br0\">]<\/span> <span class=\"kw1\">WITH<\/span> DEFAULT_DATABASE<span class=\"sy0\">=<\/span><span class=\"br0\">[<\/span>master<span class=\"br0\">]<\/span><span class=\"sy0\">,<\/span>\n DEFAULT_LANGUAGE<span class=\"sy0\">=<\/span><span class=\"br0\">[<\/span>us_english<span class=\"br0\">]<\/span><span class=\"sy0\">,<\/span> CHECK_EXPIRATION<span class=\"sy0\">=<\/span><span class=\"kw1\">ON<\/span><span class=\"sy0\">,<\/span> CHECK_POLICY<span class=\"sy0\">=<\/span><span class=\"kw1\">ON<\/span>\n GO\n <span class=\"kw1\">USE<\/span> <span class=\"br0\">[<\/span>master<span class=\"br0\">]<\/span>\n GO\n <span class=\"kw1\">ALTER<\/span> LOGIN <span class=\"br0\">[<\/span>sa<span class=\"br0\">]<\/span> <span class=\"kw1\">WITH<\/span> PASSWORD<span class=\"sy0\">=<\/span>N\u2019<span class=\"sy0\">&lt;<\/span>insert_new_password_here<span class=\"sy0\">&gt;<\/span>\u2019 MUST_CHANGE\n GO<\/pre><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Method 1: Login into SQL Server using Windows Authentication. In Object Explorer, open Security folder, open Logins folder. Right Click on SA account and go to Properties. Change SA password, and confirm it. Click OK. Make sure to restart the SQL Server and all its services and test new password by log into system using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[112],"tags":[22,79,80],"_links":{"self":[{"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/posts\/124"}],"collection":[{"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=124"}],"version-history":[{"count":2,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":172,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=\/wp\/v2\/posts\/124\/revisions\/172"}],"wp:attachment":[{"href":"http:\/\/www.raytawil.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.raytawil.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}