Whether or not you can create and drop databases and database objects depends on your permissions or privileges. Ordinarily, a System Administrator or Database Owner sets up the permissions for you, based on the kind of work you do and the functions you need. These permissions can be different for each user in a given installation or database.
You can determine what your permissions are by executing:
sp_helprotect user_name
user_name is your Adaptive Server login name.
To make your experiments with database objects as convenient as possible, the pubs2 and pubs3 databases have a guest user name in their sysusers system tables. The scripts that create pubs2 and pubs3 grant a variety of permissions to “guest.”
The “guest” mechanism means that anyone who has a login on Adaptive Server, that is, anyone who is listed in master..syslogins, has access to pubs2 and pub3, and permission to create and drop such objects as tables, indexes, defaults, rules, procedures, and so on. The “guest” user name also allows you to use certain stored procedures, create user-defined datatypes, query the database, and modify the data in it.
To use the pubs2 or pubs3 database, issue the use command. Adaptive Server checks whether you are listed under your own name in pubs2.sysusers or pubs3..sysusers. If not, you are admitted as a guest without any action on your part. If you are listed in the sysusers table for pubs2 or pubs3, Adaptive Server admits you as yourself, but may give you different permissions from those of “guest.”
All the examples in this chapter assume you are being treated as “guest.”
Most users can look at the system tables in the master database by means of the “guest” mechanism previously described. Users who are not recognized by name in the master database are allowed in and treated as a user named “guest.” The “guest” user is added to the master database in the script that creates the master database when it is installed.
A Database Owner, “dbo,” can add a “guest” user to any user database using sp_adduser. System Administrators automatically become the Database Owner in any database they use. For more information, see Chapter 13, “Getting Started With Security Administration in Adaptive Server,” in the System Administration Guide: Volume 1.