SQL Server 2005: How to Reset a Forgotten Password for the sa Account

Contributor Icon Contributed by shamanstears Date Icon December 22, 2008  
Tag Icon Tagged: Database

If you’ve forgotten the sa password for your SQL server, you are probably in a panic. Fear not, for you can reset the password and once again have access to the powers of the sa account by using the query window in the Management Studio.

1. Open the SQL Server Management Studio.

2. Open a New Query.

3. Copy, paste, and execute the following:

GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
GO

where NewPassword is the password you wish to use for the sa account.

You can now breathe easier, and once again access the sa account. Whew!

Previous recipe | Next recipe |
 
  • Great! This should be useful in the future.. or not! Maybe when i'm 70 years old ;)
  • Sathish
    It's a useful Tip. It helped me to reset the password. Thank you.
  • vijay
    Its very useful for me.
  • subahani
    thanks budy
    i seached something else but i got beter than that
blog comments powered by Disqus