Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login Sync

Status
Not open for further replies.

YL5956

MIS
Joined
Jul 11, 2001
Messages
73
Location
US
I restore a copy of our production database into a test machine. I want to sync up the user logins. I'm running into problems when I try to create a new user. It says a user already exist. How can I resolve this? Do I go into the SYSUSER table on that database and delete the user then recreate them? How do I sync the passwords? Is this a clean way to recreate logins or is there a better way? Thanks.
 
Use sp_change_users_login in the database to synchronize users and logins. The SP is documented in SQL BOL and at this link.

Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Terry,

Thanks for you help but what if I don't want to recreat all the logins? how do I clean out the database? Do I just delete the rows from SYSUSERS that I don't need?
 

Try using sp_revokedbaccess to drop users. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top