| The sa account has full rights in the MS SQL Sever | | | | and then press ENTER:sp_password @old = null, |
| environment. When you install the MS SQL Server | | | | @new = ‘complexpwd’, @loginame |
| program, the sa account is created and sa password | | | | =’sa’ go |
| is default blank (NULL). You can also change the blank | | | | Note Make sure that you replace “complexpwd” |
| sa password to a strong one when the setup | | | | with the new strong password. A strong password |
| program is running. | | | | includes alpha-numeric and special characters, and a |
| How to verify if the SA password is blank | | | | combination of upper and lower case characters. |
| 1 On the computer that is hosting the instance of | | | | You will receive the following informational message, |
| MSDE to which you are connecting, open a command | | | | which indicates that your password was changed |
| prompt window. | | | | successfully: Password changed. |
| 2 At the command prompt, type the following | | | | Besides, taking use of the third part tool to change sa |
| command, and then press ENTER:osql -U sa | | | | password is also a good way. It is fast and easy. |
| This connects you to the local, default instance of | | | | More refer: |
| MSDE by using the sa account. To connect to a | | | | How to determine or change your authentication mode |
| named instance installed on your computer type:osql -U | | | | Important This section, method, or task contains steps |
| sa -S servernameinstancename | | | | that tell you how to modify the registry. However, |
| You are now at the following prompt: | | | | serious problems might occur if you modify the registry |
| Password: | | | | incorrectly. Therefore, make sure that you follow these |
| 3 Press ENTER again. This will pass a NULL (blank) | | | | steps carefully. For added protection, back up the |
| password for sa. | | | | registry before you modify it. Then, you can restore |
| If you are now at the following prompt, after you press | | | | the registry if a problem occurs. For more information |
| ENTER, then you do not have a password for the sa | | | | about how to back up and restore the registry, click |
| account: | | | | the following article number to view the article in the |
| 1> | | | | Microsoft Knowledge Base: |
| We recommend that you create a non-NULL, strong | | | | 322756 ( ) How to back up and restore the registry in |
| password to conform with security practices. | | | | Windows |
| However, if you receive the following error message, | | | | If you are not sure how to verify the authentication |
| you have entered an incorrect password. This error | | | | mode of your MSDE installation, you can check the |
| message indicates that a password has been created | | | | corresponding registry entry. By default, the value of |
| for the sa account: | | | | the Windows LoginMode registry subkey is set to 1 for |
| “Login Failed for user ’sa’.” | | | | Windows Authentication. When Mixed Mode |
| 4 The following error message indicates that the | | | | authentication is enabled, this value is a 2. |
| computer that is running SQL Server is set to | | | | · The location of the LoginMode subkey depends on |
| Windows Authentication only: | | | | whether you installed MSDE as the default MSDE |
| Login failed for user ’sa’. Reason: Not | | | | instance or as a named instance. If you installed MSDE |
| associated with a trusted SQL Server connection. | | | | as the default instance, the LoginMode subkey is |
| 5 You cannot verify your sa password while in | | | | located in the following registry subkey: |
| Windows Authentication mode. However, you can | | | | inMode |
| create a sa password so that your sa account is | | | | Note If you are using SQL Server 2005, whatever you |
| secure in case your authentication mode is changed to | | | | installed a default instance or a named instance, locate |
| Mixed Mode in the future. | | | | the following registry subkey. MSSQL.x is a |
| If you receive the following error message, SQL | | | | placeholder for the corresponding value for your |
| Server may not be running or you may have provided | | | | system: |
| an incorrect name for the named instance of SQL | | | | soft SQL ServerMSSQL.xMSSQLServer |
| Server that is installed: | | | | · If you installed MSDE as a named instance, the |
| [Shared Memory]SQL Server does not exist or | | | | LoginMode subkey is located in the following registry |
| access denied. | | | | subkey: |
| [Shared Memory]ConnectionOpen (Connect()). | | | | HKLMSoftwareMicrosoftMicrosoft SQL |
| Or, you can install MS SQL Server Password Unlocker | | | | Server%InstanceName%MSSQLServerLoginMode |
| to check if the sa password is blank or not. Just one | | | | Note Before you switch authentication modes, you |
| mouse click, you can view the result. Note that this | | | | must set a sa password to avoid exposing a potential |
| program just identify .mdf file, and the sa password is | | | | security hole. |
| saved in master.mdf which is usually at C:Program | | | | To switch from Mixed Mode to Integrated (Windows) |
| FilesMicrosoft SQL ServerMSSQLDatamaster.mdf | | | | authentication, follow these steps: |
| | | | 1 To stop MSSQLSERVER and all other related |
| MS SQL Server Password Unlocker | | | | services (such as SQLSERVERAgent), open the |
| How to change your SA passwordloadTOCNode(2, | | | | Services applet in Control Panel. |
| ’summary’); | | | | 2 Open the Registry Editor. To open the Registry |
| 1. On the computer that is hosting the instance of | | | | Editor, click Start, click Run, and then type: |
| MSDE to which you are connecting, open the | | | | “regedt32? (without the quotation marks) |
| command prompt window. | | | | Click OK. |
| 2. Type the following command, and then press | | | | 3 Locate either of the following subkeys (depending on |
| ENTER:osql -U saAt the Password: prompt, press | | | | whether you installed MSDE as the default MSDE |
| ENTER if your password is blank or type the current | | | | instance or as a named instance: |
| password. This connects you to the local, default | | | | rverMSSqlServer |
| instance of MSDE by using the sa account. To | | | | 4 Or |
| connect by using Windows authentication, type this | | | | SQL Server<Instance Name>MSSQLServer |
| command: use osql -ENote If you are using SQL | | | | 5 In the right-pane, double-click the LoginMode subkey. |
| Server 2005 Express, avoid using the Osql utility, and | | | | 6 In the DWORD Editor dialog box, set the value of |
| plan to modify applications that currently use the Osql | | | | this subkey to 1. Make sure that the Hex option is |
| feature. Use the Sqlcmd utility instead.For more | | | | selected, and then click OK. |
| information about the Sqlcmd utility, visit the following | | | | 7 Restart the MSSQLSERVER and the |
| Microsoft Developer Network (MSDN) Web site: ( | | | | SQLSERVERAgent services for this change to take |
| 3. Type the following commands, on separate lines, | | | | effect. |