Creating groups

Groups provide a convenient way to grant and revoke permissions to more than one user in a single statement. Groups enable you to provide a collective name to a group of users. They are especially useful if you administer an Adaptive Server installation that has a large numbers of users. Every user is a member of the group “public” and can also be a member of one other group. (Users remain in “public,” even when they belong to another group.)

It is probably most convenient to create groups before adding users to a database, since sp_adduser can assign users to groups as well as add them to the database.

A System Administrator or the Database Owner can create a group at any time with sp_addgroup. The syntax is:

sp_addgroup grpname

The group name, a required parameter, must follow the rules for identifiers. The System Administrator can assign or reassign users to groups with sp_changegroup.

To set up the Senior Engineering group, use the following command while using the database to which you want to add the group:

sp_addgroup senioreng

sp_addgroup adds a row to sysusers in the current database. Therefore, each group in a database, as well as each user, has an entry in sysusers.