Orphaned Microsoft SQL users can occur when the user is in the database but not in the instance, even if you create an identical username the user on the database won’t match the instance user. This is all to do with the GUID (called a SID in Microsoft terms) that do not match,
1. Check to see if there are actually orphaned users:
USE <database_name>; GO; sp_change_users_login @Action='Report'; GO;
2. Relink the server login already specified by <login_name> with the database user specified by <database_user>
USE <database_name>; GO sp_change_users_login @Action='update_one', @UserNamePattern='<database_user>', @LoginName='<login_name>'; GO
Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.