Lost the sa password on MSSQL

  • sa is the System Admin account.
  • Many operations require sa account.

Applies to:

  • Microsoft SQL Server 2005
  • Microsoft SQL Server 2000

Change sa password

ALTER login sa WITH password = '123456';
go
Command(s) completed successfully.
  1. You cannot recover the sa password.
  2. You can change the sa password.
  3. You need to be part of the administrator group.
  4. On MSSQL 2000, you can use:
SP_PASSWORD @NEW = '123456', @loginame = 'sa'
  • sp_password will be deprecated soon.