Fix / restore user and login mappings in SQL Server

If you restore a SQL Server (< 2012) database on an other database server make sure you fix the user and login mappings by following the steps on

Short fix:

use MyDatabase


sp_change_users_login ‘update_one’, ‘myusername’, ‘myloginname’



On SQL Server 2012 you can use Contained Databases, see

Leave a Reply

Your email address will not be published. Required fields are marked *