SQL SERVER – Reset sa Password

01Nov08

1.Open the SQL Server express management studio
2.Connect to SQL Server using windows authentication
3.Right click the server name and choose properties
4.Go to security tab. Change server authentication to “SQL Server and Windows Authentication mode”
5.Click OK and restart SQL Server
6.Go to SQL Server studio management express
7.Expand the server and choose security and expand logins
8.Right click on SA, from properties modify the password and confirm password

OR

To reset the sa password, you can make the following:
1. Login to the SQL Server box as the Administrator.
2. Run SQL Server Enterprise Manager.
3. Right-click the server name and choose ‘Edit SQL Server Registration properties’.
4. Choose ‘Use Windows authentication’ and click OK button.
5. Expand a server, expand a Security and click Logins.
6. Double-click the sa login and specify new password on the General tab. (enable Login to)

Or You Can Use

USE [master]
GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N'<insert_new_password_here>’ MUST_CHANGE
GO

or

From a command prompt
OSQL -S <insert_servername_here> -E
1> EXEC sp_password NULL, ‘<insert_new_password_here>’, ‘sa’
2> GO



5 Responses to “SQL SERVER – Reset sa Password”

  1. I tried to use the below code :
    USE [master]
    GO
    ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master],
    DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=ON, CHECK_POLICY=ON
    GO
    USE [master]
    GO
    ALTER LOGIN [sa] WITH PASSWORD=N’’ MUST_CHANGE
    GO

    but I got the error :
    The MUST_CHANGE option is not supported by this version of Microsoft Windows.

    Please suggest. I am using SQL SERVER 2008 Express Edition.

  2. 2 happykaka

    A few days ago, I had a painful exprience that I lost sa password on my MS SQL Server database, and I almost took the whole weekend to look for some efficient SA password recovery solutions. I asked friends, searched on Internet and even bought some books… Fortunately, I finally got MS SQL Server Password Unlocker and it instantly changed the SA password but no data loss.

    • 3 sreedhar

      A few days ago, I had a painful exprience that I lost sa password on my MS SQL Server database, and I almost took the whole weekend to look for some efficient SA password recovery solutions. I asked friends, searched on Internet and even bought some books

  3. 4 worthposting

    login as windows authentication ..
    Also remember to enter a new password …

  4. If it it still doesn’t work and you can apply the changes but not login, you may need to enable mixed login mode via modifying the LoginMode registry key (from decimal value 1 to 2) located at:
    HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer

    If you cannot locate it there you may want to do a search for LoginMode from the HKLM\Software\Microsoft\Microsoft SQL Server tree in the registry.

    See the following article for further details:

    Configure Microsoft SQL Server for Mixed Mode Authentication


Leave a reply to sreedhar Cancel reply