To fix the missing login name, just execute this
EXEC sp_change_users_login 'UPDATE_ONE','Annie','Annie'
replace Annie with the name of the user
To find out the list of broken / orphaned users, you can execute this
EXEC sp_change_users_login 'REPORT'
On SQL 2005 and above, this is the query to fix
use dbname;
EXEC sp_change_users_login 'Auto_Fix', 'username', null, 'password'
No comments:
Post a Comment