Change SQL server 2005 ‘sa’ password from command line
I have this tool that using MSSQL server 2005 as its database. And I always forgot the sa password when I want to use this tool. Very annoying at first because of my idiocy, I always then reinstall the MSSQL just because I need to have correct password for ‘sa’
.
So, times goes by and this same thing happen on and on until I got this knowledge. Knowledge that makes me don’t have to reinstall MSSQL only to have a correct password for ‘sa’. Quite simple and only took less than a minute to do so from command prompt. Here is the command :
From a command shell (start > run > cmd)
OSQL -S <YOUR_SERVERNAME_GOES_HERE> -E
1> EXEC sp_password NULL, ‘blah’, ‘sa’
2> GO
1> exit
that’s all. After that you can enjoy accessing you MSSQL server 2005 database with brand new ‘sa’ password
Advertisement