What can be done, if anything, when the special
guest user is orphaned (not linked to any login)?
For one of my databases (SQL Server 2005), executing the following lists the guest user as an orphaned user.
exec sp_change_users_login 'report'
UserName UserSID guest 0x3C2E66759FFBC14F84127D6795C27FD3
If I try to fix the guest user using that procedure, I get the following:
exec sp_change_users_login 'update_one', 'guest', 'guest'
Terminating this procedure. 'guest' is a forbidden value for the login name parameter in this procedure.
If I try to delete the user, I get:
User 'guest' cannot be dropped, it can only be disabled.
select * from sys.database_principals where name = 'guest'
name guest principal_id 2 type S type_desc SQL_USER default_schema_name guest create_date 11/13/98 2:58 AM modify_date 10/16/01 4:31 PM owning_principal_id NULL sid 0x3C2E66759FFBC14F84127D6795C27FD3 is_fixed_role 0
The database seems to be confused as to whether this is a special user or not. Is there anything that can be done?