Fixing SQL Server Users after Backup Restore
Often when you restore a backup from SQL server you run into funky problems with users. Suppose you have login
cfusion and you restore a database from another server that also had user called
cfusion you can't properly use this login, and you might get the error:
Error 15023: User or role 'cfusion' already exists in the current database.
To fix this I ran:
EXEC sp_change_users_login 'Auto_Fix', 'cfusion', NULL, 'password'
And it worked like a charm.
Like this? Follow me ↯Tweet Follow @pfreitag
Fixing SQL Server Users after Backup Restore was first published on September 29, 2008.