Monday, February 16, 2004
When restoring a database, if the original SQL user accounts don't exist in the new SQL Server system, the database users will not be linked to the SQL Server users. Creating a new user with the same name won't work, because granting access to the restored database will generate a "user already exists" error.
To fix this,
- Create the user as it should be in SQL Server
- In Query Analyzer, run sp_change_users_login 'update_one', '<database user>', '<sql user>' in your restored database.
- That's it!