Search

Wednesday, February 22, 2012

Change SQL Server Password

There are many method through which you can change SQL Server Password.


Method 1
You can use Query windows of Management Studio to change password. 
Open SQL Server Management Studio, Open New Query Window and type the below command and press Execute:


Alter Login [sa] With Default_Database=[Master]
GO
Use [Master]
GO
ALTER Login [sa] With Password = N'Change Password' Must_Change
GO


After executing this 'Change Password' is set for your sa account.


Method 2
You can use Command Prompt to change Password.


Open Command Prompt (Start - Run - cmd) and type the below Command:


Osql –S <Server Name> –E 

  1. EXEC sp_password NULL, ’<Password>’, ’sa’
  2. GO
<Server Name> is the name of the SQL Server and <Password> is the password you want to set.


Method 3
You can also change Password by Windows Authentication. Open SQL Server Management Studio. Login to Management Studio with Windows Authentication. Expand Server - Security - Logins. Now double click on sa login. Here type a new Password, Confirm Password, and click on Finish. Restart SQL Server. Now you can login to SQL Server with new sa account password.

1 comment:

  1. As a Dell employee, I really appreciate your efforts on this blog that tells about changing the SQL server password. Thank you for sharing such a useful information with us.

    ReplyDelete