In Microsoft SQL Server there are two forms of “User ID's”:
Question
What happens when you are restoring a foreign database into your SQL Server. The Database has a set of users allowed to access it but there is no corresponding SQL Server “Login”?
Answer
This is where sp_change_users_login comes into play. There are two main ways to use the stored procedure:
use <DBNAME> go exec sp_change_users_login 'Auto_Fix', '<USER>',NULL,'<PASSWORD>' go
use <DBNAME> go exec sp_change_users_login 'Update_one', '<USER>','<LOGIN>' go