While working on Mysql server many security experts’ recommend for changing passwords frequently to enhance security. It is nothing difficult to change the password of SQL Server Users, you can easily change the password on a SQL Server Username via Query Analyzer. Changing the password with Query Analyzer makes easy to synchronize change the password on the database server at the same time as it is changed in the connection string. This method provides the flexibility for changing the password at the most suitable time for the application.
To change the SQL Server Username password, just you need to connect to the database with “Query Analyzer” using the SQL Server Username which is going to be updated along with the current password and then run:
“sp_password” to change the password.
sp_password [ [ @old = ] ‘old_password’ , ]
{ [ @new =] ‘new_password’ }
[ , [ @loginame = ] ‘login’ ]
The Office Microsoft Documentation for sp_password
Here is a plain example that changes the current password from
“currentPSWD” to “newPSWD”;
sp_password ‘currentPSWD’, ‘newPSWD’
Make sure to use a strong password, (”newPSWD” as demonstrated above is just an example) and do a quick test to confirm that the new password is working, close Query Analyzer and then re-connect with the new password.
It is obvious, but still difficult to remember to change the password in your connection string if this SQL Username is used in your code. Once you’ve changed the password and confirmed after testing it with Query Analyzer, make sure to update the connection string with the new password and confirm that the whole thing working properly.


















