2

I had deleted a system user "sysuser" from the server. I had previously used this user to login to SQL Server through "Windows Authentication" mode.

Now, I tried to create a new user with the same username and password but am unable to login to the SQL Server again.

I deleted the user in the server from control panel. Then I log in to SQL Server using windows authentication but cannot log in. I tried to add back the user with same password using control panel. I tried to log in SQL Server using windows authentication and the re-created user but still cannot log in.

  • Give this a shot. delete the SQL Login from SQL Server at the server level from SQL Server (this is SQL Server > Security > Logins from SSMS)....(not the local machine/server) and then go into each DB where it also had access defined and delete that same login from of the DBs in SQL Server (DB > Security > Logins)... Then ensure the OS Server level account is created and then add it back to SQL Server from SSMS Security > Logins and then grant the needed DB security including CONNECT access and then try accessing SQL.... Might be a SID issue since you deleted the OS account and not SQL – Pimp Juice IT Jul 21 '16 at 13:40
2

When you add a Windows Authentication login to SQL Server, the login gets created using the Windows Security ID, or SID, of the Windows user to create the login.

The name of the login is irrelevant, since authentication occurs via the SID.

If you delete and re-create a Windows user that has a login in SQL Server, the newly created Windows user will have a different SID than the old user, and hence will not be linked to the SQL Server login. In order to have the new Windows user login to SQL Server, you need to create a new SQL Server login for the user via the CREATE LOGIN T-SQL statement, as in:

CREATE LOGIN <login_name>
FROM WINDOWS;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.