JamesRadford
JamesRadford

Reputation: 73

sql studio express 2005 lost sa password issue

I have a problem, I'm using windows 7 with MS SQL Server Management Studio Express 2005 although I've lost my administrator/ sa password. Is there a command I can use to reset the password, without the old one?

I can login using windows authenication.

many thanks, James

Upvotes: 3

Views: 4915

Answers (3)

Eduardo A
Eduardo A

Reputation: 371

Because you can login using your windows authentication then it's pretty easy. what you need is just

  1. login to your management studio,
  2. on the tree view, expand "security" folder, and also expand the "Logins" folder,
  3. right click on "sa"
  4. change the password. done

Upvotes: 0

THE DOCTOR
THE DOCTOR

Reputation: 4555

Login to the SQL Server computer as the Administrator of that computer. Open Query Analyzer and connect to SQL Server using Windows NT authentication. Run sp_password as shown below to reset the sa password:

sp_password @new = 'will_never_forget_again', @loginame = 'sa'

EDIT:

This is unexpected, as you were able to get in to detach a db, so you must have some privileges. The message you got: ... is a response to the sp_password command. So when you say you tried to reconnect with 'sa', can you tell us how you did that?

Also, when using the SQLCMD tool, you have to type GO to execute a command:

SP_PASSWORD @NEW = 'my_password', @loginame = 'sa'
GO

Then you need to exit before you try to reconnect.

Try getting in again, and seeing who you are. So after connecting:

C:\sqlcmd -E  -d master

Please run this:

SELECT suser_sname(), user_name()
GO

Also, run this after you obtain your user name and enter your new password per my original answer:

ALTER LOGIN sa ENABLE
GO

Upvotes: 3

Espen Olsen
Espen Olsen

Reputation: 43

In the object explorer, go to Security-> Logins and click on preferences for the "sa"-account. There you can reset the password

Upvotes: 0

Related Questions