Sql studio express 2005 lost password for passwords

I have a problem, I am using Windows 7 with MS SQL Server Management Studio Express 2005, although I have lost the / sa admin password. Is there a command that I can use to reset the password without the old one?

I can log in using Windows Authentication.

Thanks a lot James

+3
source share
3 answers

Log on to the SQL Server computer as the administrator of this 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:

, db, . , : ... sp_password. , , , ?

, SQLCMD GO, :

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

, .

, . :

C:\sqlcmd -E  -d master

:

SELECT suser_sname(), user_name()
GO

, , :

ALTER LOGIN sa ENABLE
GO
+3

Security- > Logins "sa" -account. reset

0

Since you can log in using Windows authentication, this is pretty easy. you just need

  • enter your management studio
  • in the tree, expand the "Security" folder, as well as the "Logins" folder,
  • right click on "sa"
  • change the password. Done
0
source

Source: https://habr.com/ru/post/1783739/


All Articles