Tuesday, February 05, 2008

Reset Microsoft SQL "sa" password

Just few weeks ago I setup a SQL Server(Microsoft SQL Desktop Edition), and now when I need to install another client PC but forgotten the command to reset the "sa" password through command line using Windows authentication mode.

I researched around and found out that there's only a slight different to the parameters to login using sql authentication;

Using Windows Authentication mode

osql -E

Using sa account

osql -U sa

In order to reset the password for "sa", after log into the sql, proceed to perform below command;

sp_password @old = null, @new = 'complexpwd', @loginame ='sa'

With that, "complxpwd" will be your new password.


Your Ad Here