Article ID: 315523 - Last Review: April 27, 2005 - Revision: 6.3 Removal of the guest account may cause a 916 error in SQL Server 2000 SP4 or a handled exception access violation in earlier versions of SQL Server 2000This article was previously published under Q315523 On This PageSYMPTOMS If you expand a database folder in Microsoft SQL Server Enterprise
Manager (SEM), a handled exception access violation (AV) occurs if all the
following conditions are true:
Error 916 - Server user 'DelSysusers_003_Login' is not a valid user in database 'db_DelSysusers_003' Note This behavior is not limited to expanding a database folder in SEM. The behavior can also occur if an application tries to use a database that has had the guest account removed. RESOLUTION To prevent the behavior, do not manually delete the system
supplied user accounts from any of the SQL Server databases. Microsoft does not
support the removal of system supplied users including guest and dbo. WORKAROUND To work around the problem, query the sysusers system table in all the databases, including the system databases
and make sure that the guest and all other system users exist in each of the
databases. Please note that the sp_helpuser stored procedure may not display all the system supplied users. Therefore, you must directly query the sysusers system table. The guest user account must always be allowed access to the master and tempdb databases. By default the guest user is denied access to the model database. Therefore, the guest user does not have access to any of the new databases that you create. If you want to allow the guest account access in any of the databases, use the sp_grantdbaccess stored procedure to grant access. For example, to allow a guest user account access to a database named Accounts, run the following code in the SQL Server Query Analyzer: After you execute sp_revokedbaccess or sp_dropuser for the guest account, it remains in the sysusers table but you cannot use it. At this point, the column "HasDBAccess" has been marked to 0/false for the guest ID. Because it is a special ID, it is not actually removed from the table, but no access is permitted. If you do sp_helpuser when HasDBAccess = 0/false, the guest row is not displayed. If you sp_helpuser when HasDBAccess = 1/true, it is not displayed. When it is not visible in sp_helpuser, no one can use it to gain access. If you execute sp_helpuser when HasDBAccess = 0/false, the guest row is not displayed. If you execute sp_helpuser when HasDBAccess = 1/true, the guest account is displayed. When it is not visible in sp_helpuser, no one can use it to gain access. If HasDBAccess = 0/false for guest, stored procedures such as sp_dropuser and sp_revokedbaccess treat it as if it does not exist. If you execute sp_revokedbaccess 'guest' when HasDBAccess = 0/false for guest, the stored procedure returns the following message: Server:
Msg 15008, Level 16, State 1, Procedure sp_revokedbaccess, Line 36 User 'guest' does not exist in the current database. If an unsupported, direct delete of the guest user has been executed on the sysusers table of one of the user databases, you can fix the problem by using the following stored procedure and re-create the guest row: MORE INFORMATION If the AV occurs, SQL Server may generate a stack dump and
write out information to the SQL Server error log file and a symptom dump file
is generated. The beginning of the stack dump in the SQL Server error log file
may appear similar to the following examples. SQL Server 2000 Service Pack 2* BEGIN STACK DUMP: * 01/25/02 14:00:17 spid 51 * Exception Address = 00401EA0 (RecBase::Resize + 00000005 Line 0+00000000) * Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION * Access Violation occurred reading address 00000000 * Input Buffer 68 bytes - * exec sp_MSdbuseraccess N'db', N'%' --------------------------------------------------------------------------- * Short Stack Dump * 00401EA0 Module(sqlservr+00001EA0) (RecBase::Resize+00000005) * 00441CFD Module(sqlservr+00041CFD) (CSysScan::GetVaried+0000002A) * 005ACC39 Module(sqlservr+001ACC39) (CUserScan::CbGroupBitmap+00000016) * 00622033 Module(sqlservr+00222033) (SecCache::FGetFromDiskScedb+00000317) * 0043FF36 Module(sqlservr+0003FF36) (checkdbperm+000000EF) * 004400FF Module(sqlservr+000400FF) (usedb+0000009F) * 00624ABE Module(sqlservr+00224ABE) (FHasDbaccess+00000076) * 005B99A4 Module(sqlservr+001B99A4) (I4HasDbaccessWstr+00000011) * 00419CE3 Module(sqlservr+00019CE3) (CEs::GeneralEval4+00000059) * 0042F36B Module(sqlservr+0002F36B) (CStmtAssign::XretExecute+00000102) * 0040F403 Module(sqlservr+0000F403) (CMsqlExecContext::ExecuteStmts+000002D9) * 0040EA95 Module(sqlservr+0000EA95) (CMsqlExecContext::Execute+000001B6) * 00410159 Module(sqlservr+00010159) (CSQLSource::Execute+00000331) * 0046C55A Module(sqlservr+0006C55A) (CStmtExec::XretLocalExec+0000014D) * 0046C3F6 Module(sqlservr+0006C3F6) (CStmtExec::XretExecute+0000031A) * 0040F403 Module(sqlservr+0000F403) (CMsqlExecContext::ExecuteStmts+000002D9) * 0040EA95 Module(sqlservr+0000EA95) (CMsqlExecContext::Execute+000001B6) * 00410159 Module(sqlservr+00010159) (CSQLSource::Execute+00000331) * 0053C498 Module(sqlservr+0013C498) (language_exec+000003E1) * 00411099 Module(sqlservr+00011099) (process_commands+000000EC) * 41073379 Module(UMS+00003379) (ProcessWorkRequests+0000024A) * 41073071 Module(UMS+00003071) (ThreadStartRoutine+000000BD) * 7800A27B Module(MSVCRT+0000A27B) (beginthread+000000CE) * 77E8758A Module(KERNEL32+0000758A) (SetFilePointer+0000018A) --------------------------------------------------------------------------- Microsoft SQL Server 7.0 RTMShort Stack Dump 0x00402624 Module(sqlservr+2624) (RecBase::Resize+3) 0x00405897 Module(sqlservr+5897) (RecBase::LocateVarColumn+10) 0x004115db Module(sqlservr+115db) (CSysScan::GetVaried+34) 0x005bf61d Module(sqlservr+1bf61d) (CUserScan::CbGroupBitmap+16) 0x00519c89 Module(sqlservr+119c89) (SecCache::FGetFromDiskScedb+2a6) 0x004042df Module(sqlservr+42df) (checkdbperm+dd) 0x00446d6b Module(sqlservr+46d6b) (login+2e8) 0x4106187f Module(opends60+187f) (execute_event+659) 0x410645a5 Module(opends60+45a5) (process_login+78) 0x41061b43 Module(opends60+1b43) (process_commands+d6) 0x41068eff Module(opends60+8eff) (process_loginread+14c) 0x41092be1 Module(ums+2be1) (ProcessWorkRequests+ed) 0x4109336a Module(ums+336a) (ThreadStartRoutine+139) 0x77c37e53 Module(MSVCRT+27e53) (endthread+aa) 0x77e802ed Module(kernel32+202ed) (OpenConsoleW+b8) 0x00000000 Module(sqlservr+ffc00000) ---------------------------------------------------------------------------
| Article Translations
|
Back to the top
