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

This site uses Akismet to reduce spam. Learn how your comment data is processed.