I had a scenario where i forgot SA password or windows authentication was not working.
So i used the below method to reset the SA password to login into SQL Server.
Step 1:-
Change SQL SA password from a command prompt
Go to the command prompt of the server and type in command prompt osql –L
C:\Users\Administrator>osql -L
Servers:
localhost
Step 2:-
Copy full name of SQL Server and type: OSQL -S <insert_servername_here> -E
C:\Users\Administrator>osql -S localhost -E
Step 3:-
Execute the following query: sp_password NULL, '<insert_new_password_here>', 'sa'
1> sp_password NULL, 'soumya@123#','sa'
2> GO
Done, the sa password has been reset.
So i used the below method to reset the SA password to login into SQL Server.
Step 1:-
Change SQL SA password from a command prompt
Go to the command prompt of the server and type in command prompt osql –L
C:\Users\Administrator>osql -L
Servers:
localhost
Step 2:-
Copy full name of SQL Server and type: OSQL -S <insert_servername_here> -E
C:\Users\Administrator>osql -S localhost -E
Step 3:-
Execute the following query: sp_password NULL, '<insert_new_password_here>', 'sa'
1> sp_password NULL, 'soumya@123#','sa'
2> GO
Done, the sa password has been reset.
No comments:
Post a Comment