I restored a database to my test server from a production server. I ran "sp_change_users_login 'report' " and found 1 orphan id. Then I ran "sp_change_users_login 'auto_fix', 'orphan_id' ". It gets the error. I have run it before with success. Any idea why this time is different?
Once scenario where this may exist is if there is no login to fix the mappings with, then the procedure tries to create the login but you haven't specified a password. In that case, you have to use:
exec sp_change_users_login 'Auto_Fix', 'YourLogin', null, 'YourPassword'
I would guess that when it worked before, the login existed so it just remapped the database user to the existing login.
-Sue
|||If you are using SQL Server 2005 SP2, you can also try ALTER USER ... WITH LOGIN syntax.
Please, let us know if you were able to solve the problem or if you have any additional questions .
Thanks a lot,
-Raul Garcia
SDE/T
SQL Server Engine
No comments:
Post a Comment