Back

Topic

[KB462]How to change SQL server password

Tags: MSSqlServer, SQL, SQL Server

13 years ago
By RM
Options
Print
Applies to:

PcVue version 8.10 onwards.


Summary:

What to do if you forget the password needed for SQL to connect its SQL Server process?


Details:

All is not lost, you can replace it with a new value without knowing the previous one so long as you have another Administrator account (via Windows authentication for example).

You should only use this work-around if you have no other choice.

Warning: Do not to change the password if other applications that you do not control use the login that you want to change.

Workaround 1: SQL script

  1. Open the tool SQL Server Management Studio.
  2. Connect to your SQL Server Process via an Administrator login.
  3. Open the Transact-SQL request editor for a new query.
  4. Replace the password you forgot, using the instruction “ALTER LOGIN”

For example to force the password for user SA’s login to a SQL Server process.

ALTER LOGIN SA WITH PASSWORD = ‘B3r1000d#236’;

GO

Workaround 2: SQL script

  1. Open the tool SQL Server Management Studio.
  2. Connect to your SQL Server Process via an Administrator login.
  3. Open the Transact-SQL request editor for a new query.
  4. Replace the login whose password you forgot, using the stored procedure “sp_password.”

For example to force the password for user SA’s login to a SQL Server process.

sp_password NULL, ‘arcinfo’, sa

Workaround 3: Graphically with SSMS

  1. Open the tool SQL Server Management Studio.
  2. Connect to your SQL Server Process via an Administrator login.
  3. In the Object Explorer, go to Security, Logins.
  4. Right-click on the SA username and select Properties.
  5. In the General tab, enter the password then select the OK button to confirm.

 


Created on: 13 Jul 2011 Last update: 13 May 2024