SQLTeam.com | Weblogs | Forums

Reset SA Password


Can we reset password of SA account through sqlcmd?


Why not? Just use sp_password or ALTER LOGIN once authenticated.


I think the command line query would be:

EXEC sp_password 'old_password' , 'new_password', 'sa'


Sorry, I am getting an error message "Login failed for user 'username'. (Microsoft SQL Server, Error: 18456)


You can follow the directions on this page: https://msdn.microsoft.com/en-us/library/dd207004.aspx