How to fix orphaned SQL login users

If ever you have the message that the login failed it may be because of an orphaned user.

Run this to check what orphaned users you have.

EXEC sp_change_users_login 'REPORT'

Then run this to fix it. Where ‘LoginName’ is the login and then the user it is attached to.

EXEC sp_change_users_login'UPDATE_ONE','LoginName','LoginName'

From this website

Comments are closed