Attaching User to a Login (SQL Server)

Probably most people already know – but it still happens often to me: When restoring a SQL database you cannot login even though the database user matches the SQL Server login. This can easily be fixed with the following command:

sp_change_users_login ‘AUTO_FIX’, ‘ [User_Name]’

Leave a Reply

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