Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Login Users of Restored Database

Author  Topic 

SamC
White Water Yakist

3467 Posts

Posted - 2004-09-14 : 16:52:31
Firstly, I'm a neophyte at admin...

When I restore a database, the users do not seem to be restored for use. They exist as users of the DB, and have the same name as the server users, but...

To resolve the problem, I delete the users using EM under the DB, then modify the server users to extend to the restored DB.

Is there a better way to handle this?

Sam

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-14 : 16:57:26
If the users already exist at the destination, you can unorphan them with chad's script.

Or run the sp_help_revlogin stored procedure on the source, copy the output to the destination, run the output.

Tara
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-09-14 : 17:00:42
Thanks. !!!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-09-15 : 14:20:44
I use the following script. It generates the appropriate SQL to reinstate a user, on a different server.

It will:

Generate a user account if one is not present
Offer to DROP a user account if one IS present
- i.e. instead of reinstating it
Reinstate an account

From the generated SQL you just choose which bits you want - e.g. I often find that Users have crept into the database that are not appropriate any more, so I drop them.

The methods Tara has described may be easier!

Kristen
Go to Top of Page
   

- Advertisement -