MS SQL Server Concepts and Programming Question:

How To Change the Password of a Login Name in MS SQL Server?

MS SQL Server Interview Question
MS SQL Server Interview Question

Answer:

If a developer lost the password of his or her login name, you can reset the password with the "ALTER LOGIN" statement as shown in this tutorial example:

-- Login with sa

ALTER LOGIN ggl_DBA WITH PASSWORD = 'globalguideline';
GO
Command(s) completed successfully.

ggl_DBA's password is changed now. Try it with the SQLCMD tool:

C:>SQLCMD -S LOCALHOSTSQLEXPRESS -U ggl_DBA -P globalguideline
1> QUIT

You can also use the "ALTER LOGIN" to change your own password.


Previous QuestionNext Question
How To List All Login Names on the MS SQL Server?How To Change a Login Name in MS SQL Server?