In SQL Server 7.0 or later versions, you can maintain the mapping between the logins in the master database and the users in the user database by using the SIDs. This mapping is required to maintain correct permissions for the logins in the user databases. When this mapping is lost, the logins have permission issues that include but are not limited to the following:
* If the SQL Server login does not exist on the new server, and the user tries to log on, the user may receive the following error message:
Server: Msg 18456, Level 16, State 1
Login failed for user '%ls'.
* If the SQL Server login exists on the new server, but the SID in the master database differs from the SID in the user database, the user can log on to SQL Server successfully; however, when the user tries to access that database, the user may receive the following error message:
Server: Msg 916, Level 14, State 1, Line1
Server user '%.*ls' is not a valid user in database '%.*ls'.
Note In SQL Server 2005, the user may receive the following error message:
Server user '%s' is not a valid user in database '%s'.
Add the user account into the database first.