Tips and Tricks in a world of Mix

Posts tagged ‘retrieve sa password’

Sql Server 2008 – forgot the sa password ( how to retrieve sa password )

go to run line



Net Start MSSQLSERVER /c /m /T3604

– Now your SqlServer running in a single mode.

Enter the Sql Server Managment Studio with server name (local) or just write  “.”  with Window Authentication.

Security –> Logins –> your Window Authentication user –> right click –> properties –> server roles –> check sysadmin

Now you can change the sa password.

Security –> Logins –> sa –> right click –> properties –> general –> enter password –> enter confirm password (pay attention for the password policy – it should have letters numbers and special chars in one ). –> ok

Don’t forget to return to a regular mode , hence :

> cmd



You got your password retrieved and the SqlServer2008 running .

That’s it !

Same with (sqlexpress)

For people having trouble with SQL Server 2008:

1. You need to first login to windows with a local administrator account.

2. You need to right-click “Command Prompt” and select “Run as Administrator”

3. Type: net stop “sql server (sqlexpress)”

4. Type: net start “sql server (sqlexpress)” /m

5. Right-click on SSMA Express and select “Run as Administrator”

6. Click “New Query” button and login to SQLExpress instance with “Windows Authentication”.

7. Type: SELECT user_name()
and hit F5 to execute. Make sure it says “dbo”

8. Delete previous statement. Then type: sp_addsrvrolemember ‘YOURDOMAIN\username’,’sysadmin’
YOURDOMAIN needs to be replaced by your domain, or if the account you’re trying to add to sysadmin isn’t a domain account then just type only the username.

9. Stop the SQL Server through Command Prompt again, and start it again but without the: /m

10. Logout of the local admin account, login with the network account that you just added as a sysadmin and “Run as Administrator” on SQL Server Management Studio Express.

Tag Cloud

%d bloggers like this: