MSSQL

Re-link user logins (usually used after a restore)

To have SQL re-create / re-link the logs run the following query in Query Analyzer (or osql.exe):

sp_change_users_login 'auto_fix', 'SOME_USER'

I've had a few instances where you needed to manually re-create the user in the Enterprise Manager and then re-link them. I've also had a particular experience where I had to delete the databases, delete the user (because that user owned certain objects in that database, we couldn't just delete the user), restore the database, create the user, then run the above script.

Syndicate content