If Windows Integrated authentication is used at SQL logon, the login box will display the login in the format "machine name \ Current system username", and the login and password are grayed out and user input is not allowed.
Understand that colleagues have just modified the server's machine name, so the "new machine name \ Current system user name" is displayed in the SQL login box. You should know that Windows Integrated authentication can log on because the user name is already included in the SQL login name. The original username was recorded in SQL at the time of SQL installation, and if the machine name is changed, the new machine name \ Current system username must not log on correctly.
Online see someone said that can be used osql–s instancename–e (input in the Command Line window) and then to modify the sa password, after some attempt to find that is a talk, because the premise of this approach is required Windows integration identity to be able to log in.
Later on Microsoft's official website to see a document, as long as in the SQL startup parameters with a "-M" option (remember to-M before the semicolon), and then need to restart the SQL service, again with SQL Management Studio Windows Integrated authentication Log on.
-M represents a single user login. Attentive readers may query: Just add-M, but the final adoption of Windows Integrated authentication, theory and the previous use of Sqlos–s instancename–e what is the difference?
This is a very professional question. At that time I did not understand, I feel a little strange, but the result is this, there must be a reason. It was later found on Microsoft's official web site.
Start the instance of SQL Server in Single-user mode by using either The-m or-f options. Any member of the computer ' s local Administrators group can then connect to the instance of SQL Server as a The sysadmin fixed server role.
Probably means that when the-M or-f parameter is added to the startup parameters of the SQL, any user of the local Administrators group of the computer can log in to SQL as sysadmin. Believe that the reader sees this place to understand. This doesn't actually check to see if the logged-on user exists in SQL, just checking that the user is a user in the administrative group of the local computer.
Well, I'm sure there's no need to be too cumbersome, just to remind readers: after modifying the sa password, remember to remove the original-m from the SQL startup parameter, and then restart the SQL service.