"Ghost" users are created when a database is backed up and restored to a different machine which uses local SQL user accounts. Even if the local SQL user account is recreated, because the underlying ID doesn't match, when the user tries to access the database the message will say the User does not exist. However when you try and add the user you will be told the user already existings. This causes access issues which at first glance seem illogical.
To fix this run the following query against the database:
use <database name>
go
sp_change_users_login 'auto_fix', '<local login name>'
No comments:
Post a Comment