Discussion Locked

SQL logins are gone after restore

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Ok this might be silly but I have almost tried everything. I had issues with one of my HD and had to rebuild the SQL Server. After restoring the all the DB's I notice that none had the original logins where in them. I tried recreating the logins and then adding them to the DB, but it tells me the login is already in the database. I tried linking orphan logins and it did not help.

The DB work but the original logins are still not there and it is buggin me. Any suggestions?

3 replies

by jmiller1

What method did you use to 'link' the orphan logins? Your best bet is to use 'sp_change_users_login'. If using that with the 'auto_fix' parameter does not work, using the 'update_one' should do the trick for you. Unfortunately, the update_one requires you to do this with each individual login, but can be scripted to be faster.

jm

This discussion is closed to new replies.