I have a development machine with a new database I have designed. The server has a login L1 and the database has a user U1. L1 is mapped to M1 and tables have permissions set up for U1. Authentication is SQL Server authentication. I wanted to fully backup the database and restore to the production server so that I could start to use it in production.
I had a problem with user U1: I could not map it to any login on the production server. So I could not use U1 with any login. Is this correct behavior?
Best Answer
You have to create a login on the prod server as when you restore the backup to PROD server, you are having an orphaned user.
So steps are :
type_desc = SQL_USER
(since you mentioned you are using SQL Login).Then run ALTER USER as below :
Note: sp_change_users_login is deprecated.