How to reset MSSQL Server “sa” password from command line

Lost “SA” password ? No worries !

The easiest way around this is to login to the SQL Server NT machine as administrator, then type the following command to reset your forgotten SA password using windows command prompt.

To open command prompt Click Start, Point to Run and type cmd, press Enter key. Once the command prompt window appear. Run the command:

C:\Program Files\Microsoft SQL Server\110\Tools\Binn\osql -S .\MSSQLSERVER2012 -E -Q "EXEC sp_password @new='NEW PASSWORD', @loginame = 'sa'"