Backup and restore are simple tasks in SQL Server. The only problem is the user mapping that may no longer work when you restore the database to a different server. If you try to remap the user, you may end up with an error like this one:
To fix the user and login mapping you need to open a query window in the SQL Server Management Studio. Enter the following two lines and replace myDB with the database name and myUser with the correct user name:
1 2 |
USE myDB EXEC sp_change_users_login 'Auto_Fix', 'myUser' |
If run successfully you should get an output like this one:
1 2 3 |
The row for user 'myUser' will be fixed by updating its login link to a login already in existence. The number of orphaned users fixed by updating users was 1. The number of orphaned users fixed by adding new logins and then updating users was 0. |
Your user should now be mapped correctly.
Thank You
Thank you very much. It was a quick fix for me
Thank You
Perfect Working very fine
Thank you
great
sehrgut