Simply forget the password, or keep it disabled, and then want to re-enable it:
The test environment is SQL Server 2008, but both 05 and R2 can be used.
1. Available
Sp_passwordNull,'123','SA'--Set sa password to "123"
2. You can also enable it and then change the password.
alter login SA enable -- enable SA go alter login [ SA ] with password = n ' newpassword ' -- no old password is required.
Note: Check the attribute ---> Security ---> server authentication when changing the settings. Is this 'SQL Server and Windows Authentication mode'
Otherwise, the following situation may occur:
Login Failed for user 'sa '. Cause: an attempt to use SQL authentication fails. The server is configured to use Windows authentication only. [Client: <Local Machine>]
Error: 18456, severity: 14, status: 58.
In this case, you need to change the body Verification Mode to 'SQL Server and Windows Authentication mode', restart the service, and then change the password to log on.
If you are not sure whether the registry is modified, check the registry information:HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ MSSQLServer
Check whether the value of "loginmode" is "1" or "2. 1" indicates windows body verification, and "2" indicates SQL Server and Windows identity authentication.
:
The following are the errorsStatusLink of Information Description:
Http://msdn.microsoft.com/zh-cn/library/cc645917.aspx