MS SQL

How to fix orphaned SQL Server users

2014-10-10 JohnyLuky 1 min read

Make sure to run all listed commands from the database you are fixing, not from Master.

List the orphaned users in the database

EXEC sp_change_users_login 'Report'

To assign/repair with an existing login:

EXEC sp_change_users_login 'Auto_Fix', 'user'

To create a new login and password for this user, use this instead:

EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'

Leave a comment