Adding a “guest” user to a database

Creating a user named “guest” in a database enables any user with an Adaptive Server account to access the database as a guest user. If a user issues the use database_name command, and his or her name is not found in the database’s sysusers or sysalternates table, Adaptive Server looks for a guest user. If there is one, the user is allowed to access the database, with the permissions of the guest user.

The Database Owner can add a guest entry to the sysusers table of the database with sp_adduser:

sp_adduser guest

The guest user can be removed with sp_dropuser, as discussed in “Dropping users”.

If you drop the guest user from the master database, server users who have not yet been added to any databases will be unable to log in to Adaptive Server.

NoteAlthough more than one individual can be a guest user in a database, you can still use the user’s server user ID, which is unique within the server, to audit each user’s activity. For more information about auditing, see Chapter 12, “Auditing.”