programming.torensma.net: Code Snippets

How to: Change ‘sa’ password on SQL server 2008

If you happen to forget your SQL Server password for ‘sa’ account, then here’s a simple query to help you reset it:

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

In Case you remember your Old Password and want to change the ‘sa’ password, use this query:

ALTER LOGIN [sa] WITH PASSWORD = N'MyNewPassword' OLD_PASSWORD = 'MyOldPassword';
GO
  • A few days ago, I had a painful exprience that I lost sa password on my MS SQL Server database, and I almost took the whole weekend to look for some efficient SA password recovery solutions. I asked friends, searched on Internet and even bought some books… Fortunately, I finally got MS SQL Server Password Unlocker and it instantly changed the SA password but no data loss. Besides, I also got a couple of good "recover SA password" solutions in order to save your weekend in case you have lost or forgot MS SQL Server passwords (SA password!)

You can follow any responses to this entry through the RSS 2.0 feed.