locked
How to reset lost sql sa password? RRS feed

  • Question

  • User2137039659 posted

    Have you ever forgot or lost your SQL Server sa password? Did you hava any ideals to reset your lost sa password? Or choosed to reinstall MS SQL Server on your PC again? I once forgot my SQL sa password and I reinstalled SQL Server at last, because I failed to find some good methods to solve the problem. What annoying and terrible experience it is! In order to avoid reinstalling SQL Server for a second time, i collect some methods and try them by myself, to reset SQL Server Password for sa account.

    Method 1: Reset SQL Server sa password by Windows Authentication

    If Builtin/Administrator is present in SQL Server, you can login with an ID which is member of Administrators group and reset sa password in SQL Server. Just do as follows:

    Step 1. Login into SQL server using Windows Authentication.
    Step 2. In Object Explorer, open Security folder, open Logins folder. Right click on sa account and go to Properties.
    Step 3. Type a new SQL sa password, and confirm it. Click OK to finish.

    Tuesday, September 21, 2010 5:08 AM

Answers

  • User2137039659 posted

    Use command prompt is also an easy way to reset lost sa password. See the commands below:

    Method 3: Use Command Prompt to reset your lost SQL sa password

    Step 1. Open a command prompt (Start -> Run -> cmd)
    Step 2. Type the follow commands, and press Enter after each line:
          Osql -S yourservername -E
          1> EXEC sp_password NULL, 'yourpassword', 'sa'
          2> GO

    Of course, you can reset your other sql account password, just by changing the 'sa' to your another sql account name.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 23, 2010 6:42 AM

All replies

  • User2137039659 posted

    And here is another way that maybe also could reset ours lost sa password, but i have problems to verify this way, can somebody give some ideas about the method.

    Method 2: Use the Query Windows in Management Studio to reset sql sa password

    Step 1. Open SQL Server Management Studio
    Step 2. Open a new query
    Step 3. Type the follow commands and excute:

          GO
          ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
          GO
          USE [master]
          GO
          ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
          GO

    The NewPassword is set for your SQL Server sa account.

    Wednesday, September 22, 2010 6:17 AM
  • User2137039659 posted

    Use command prompt is also an easy way to reset lost sa password. See the commands below:

    Method 3: Use Command Prompt to reset your lost SQL sa password

    Step 1. Open a command prompt (Start -> Run -> cmd)
    Step 2. Type the follow commands, and press Enter after each line:
          Osql -S yourservername -E
          1> EXEC sp_password NULL, 'yourpassword', 'sa'
          2> GO

    Of course, you can reset your other sql account password, just by changing the 'sa' to your another sql account name.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 23, 2010 6:42 AM
  • User1992938117 posted

    Hi,

    Shandelzare

    I am in confusion that you are asking a question or you have knowledge of how to reset password and want to share with us?

    please tell us........

    Thursday, September 23, 2010 6:52 AM
  • User2137039659 posted

    Hi,

    Shandelzare

    I am in confusion that you are asking a question or you have knowledge of how to reset password and want to share with us?

    please tell us........

    I think i have said in the above post, just collect the efficient ways for somebody or me who need. Of course, thank for your given links that maybe also helps, but i would like to have a try fist for verification. If you have, please steps.

    And now im wondering if it useful or SPAM.

    Saturday, September 25, 2010 1:48 AM
  • User1471008070 posted

    Hi Rajneesh, Shandelzare might want to share with us such efficient ways.

    @Shandelzare, it is great, I think other members will get the right direction when encounter the same issue, Thanks.

    Challen Fu

    Sunday, September 26, 2010 3:56 AM
  • User1113823209 posted

    when i change the sa password show error

    C:\Windows\system32>Osql -S NISITEC-01\SQLEXPRESS -E
    1> EXEC sp_password NULL, 'sa', 'sa'
    2> GO
    Msg 15151, Level 16, State 1, Server NISITEC-01\SQLEXPRESS, Line 1
    Cannot alter the login 'sa', because it does not exist or you do not have
    permission.
    1>

    Monday, June 17, 2013 8:47 AM
  • User-1316626729 posted

    if you steel searching for your answer then you could try thid two option:

    option 1:

    If there is any other SQL Server Login that is a member of sysadmin role, you can log in using that account and reset the password of SQL Server. Change the password of SA account.

    option 2:

    If there is any other Windows Login that is a member of Windows Admin Group, log in using that account. Start SQL Server in Single User Mode 
    Create a new login and give it sysadmin permission.

    Note : If you have SQL Server Agent enabled, it starts before SQL Server service. If you have enabled SQL Server in a single user mode, it will connect it first, so it is recommended to turn that off before attempting any of the above options.

    Friday, August 30, 2013 7:10 AM
  • Wednesday, September 11, 2013 4:47 AM