Sql Server 2005 “Login name” is blank after restoring from backup

After restoring a database from a remote server backup, the “Login name” is often disassociated.

The Solution

USE [database_name];
GO
EXEC sp_change_users_login 'Auto_Fix', 'Username';
GO

SQL should respond with the following:

The row for user 'Username' will be fixed by updating its login link to a login
already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.

For more info:
http://msdn.microsoft.com/en-us/library/ms174378.aspx