How to change the SQL Express sa password from a command prompt

To change the SQL sa password from a command prompt:

Start a command prompt by typing Start – Run – cmd

Enter the following commands, pressing Enter after each line

OSQL -S Localhost\SQLExpress -E
1> EXEC sp_password NULL, ‘New password’, ‘sa’
2> GO

 

Try to connect SQL with new password

sqlcmd -U sa -P New_Password

or

sqlcmd -S Localhost\SQLExpress -U sa -P New_Password

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s