Tuesday, March 20, 2012

Restore Database --> drop users

Third question:
I'm backing up a database which has some users.
When I try to restore it to another machine which has the same users and already has an old version of the database the database cannot be accessed. I must drop the users from the database by using the stored procedures sp_dropuser <username> and then add it again to the database from the Enterprise Manager.

Why this happens??

Regards,
ManolisThat problem is due to the way that SQL Server implements the connection between logins and users. A simpler suggestion would be to use sp_change_users_login (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_ca-cz_8qzy.asp) instead.

-PatP

No comments:

Post a Comment