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 who has not been added to the database as a user or an aliased user issues the use database_name command, 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 use sp_adduser to add a guest entry to the sysusers table of the database:

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 cannot log in to Adaptive Server.

NoteAlthough more than one individual can be a guest user in a database, Adaptive Server can still use the user’s server user ID, which is unique within the server, to audit each user’s activity. See Chapter 10, “Auditing.”