Reset SA password for SQL server 2000/2005/2008
Friday, 18. November 2011
When you forgot SA password and could not access SQL server 2000/2005/2008, you have to reset SA password at that moment. To change the password, we can use a third-party commercial tool, or take advantage of a trick.
Tip 1 MS SQL Server Password Unlocker
For computer newbie, we suggest you utilize the easier way- MS SQL Server Password Unlocker.
SQL Server Password Unlocker could reset password for SQL server 2000/2005/2008. It works to modify the master.mdf file which stores SQL login password, in that way, it resets SA password.
The procedures are simple too: once you import the master.mdf to SQL Password Unlocker, it will quickly list all the logins. Select SA account and click change password button to input a new SQL server password, and then you are able to log on to SQL Server with the new password under SQL server authentication.
Note:
1. Make sure that you have reset SA password to a strong one. A strong password includes alpha-numeric and special characters, and a combination of upper and lower case characters.
2. SQL password Unlocker will change master.mdf file, for this reason, we highly recommend that you backup master.mdf first!
Tip 2 Command Prompt
1. On the computer that is hosting the instance of MSDE to which you are connecting, open the command prompt window.
2. Type the following command, and then press ENTER:
osql -U sa
At the Password: prompt, press ENTER if your password is blank or type the current password. This connects you to the local, default instance of MSDE by using the SA account. To connect by using Windows authentication, type this command: use osql -E
3. Type the following commands, on separate lines, and then press ENTER:
sp_password @old = null, @new = 'complexpwd', @loginame ='sa'
go
You will receive the following informational message, which indicates that you have reset SA password successfully:
Password changed.
More information about SA password:
According to Microsoft, System administrator (SA) is a special login provided for backward compatibility. By default, it is assigned to the sysadmin fixed server role and cannot be changed. Although it is a built-in administrator login, SA does not be used routinely. Instead, make system administrators members of the sysadmin to be fixed server role, and have them log on using their own logins. Use SA only when there is no other way to log in to an instance of Microsoft SQL Server.








