/* A user gets often gets orphaned (or broken) when attaching a database to a new server.
Documentation:
http://msdn2.microsoft.com/en-us/library/ms174378.aspx
*/ EXECUTE sp_change_users_login @Action='Auto_Fix', @UserNamePattern='my_orphaned_user', @Password='myS3curePassw0rd'
-- This command is available in SQL Server 2000.