How to change a password for the `sa` user in MS SQL?

Created:

2016-11-16 13:09:45 UTC

Modified:

2017-06-30 17:36:17 UTC

2

Was this article helpful?


Have more questions?

Submit a request

How to change a password for the `sa` user in MS SQL?

Question

How to change a password for the `sa` user in MS SQL?

Answer

This can be done using the command prompt or using Microsoft SQL Management Studio.

1. Using the command prompt:

  • For a local MS SQL server use the following command:
    osql -E -Q "exec sp_password NULL,'new_password','sa'"
  • For a remote MS SQL server use the following command:
    osql -S servername_or_address -E -Q "exec sp_password NULL,'new_password','sa'"

2. Using Microsoft SQL Management Studio:

  • Open Microsoft SQL Management Studio 2012. It can be done from the command line by executing ssms.exe.
  • Login into Microsoft SQL Management Studio with Administrator user credentials.
  • Go to Security > Logins > sa > properties.
  • Change the password.
Note: This actions are possible for Administrator account only.
Have more questions? Submit a request
Please sign in to leave a comment.