Article ID: 298758 - View products that this article applies to.
This article was previously published under Q298758
Executing the sp_change_users_login procedure with the optional Auto_Fix option may create logins with a NULL password for users without an existing corresponding login.
By using the Auto_Fix option, you are requesting that SQL Server make "best guess" matches between database users and server logins. If no appropriate login exists, you are asking it to create one, but SQL Server does not know what password you want that login to have.
You can work around this problem in the following ways:
In versions of SQL Server 2000 that are earlier than Service Pack 3 (SP3), when you run sp_change_users_login with the auto_fix option when a corresponding logon does not exist, a logon with a NULL password is automatically created and you receive the following message:
. In SQL Server 2000 SP3 and later, when you run sp_change_users_login with the auto_fix option when a corresponding logon does not exist, a logon is not created, and you receive the following message:
New login created. Barring a conflict, the row for user 'User_Name' will be fixed by updating its link to a new login. Consider changing the new password from null. The number of orphaned users fixed by updating users was 0. The number of orphaned users fixed by adding new logins and then updating users was 1.
For general information about moving databases, see the following article:
Server: Msg 15290, Level 16, State 1, Procedure sp_change_users_login, Line 137 Terminating this procedure. The Action 'auto_fix' is incompatible with the other parameter values ('User_Name', '(null)').
224071An additional security risk with sp_change_users_login is described in the SQL Server Books Online topic "sp_change_users_login":
(https://support.microsoft.com/kb/224071/EN-US/ )INF: Moving SQL Server Databases to a New Location
"Auto_Fix makes best estimates on links, possibly allowing a user more access permissions than intended."
Article ID: 298758 - Last Review: November 21, 2003 - Revision: 4.2