............ Have a nice day............

Monday 8 April 2013

How to Change SA Password in SQL Server 2005 by Query Analyzer


Forgot SQL Server password and unable to login using the SA account? If you happen to forget your SQL Server password for sa account, then here’s a simple query to help you reset it:
GO
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

No comments:

Post a Comment