sp_CreateGroup

Advantage SQL Engine

Create a new user group in the database.

Syntax

sp_CreateGroup(

GroupName,CHARACTER,100,

Comment,MEMO );

Parameters

GroupName (I)

Name of the user group to create.

Comment (I)

Optional description of the user group. This parameter can be NULL.

Special Return Codes

AE_INVALID_OBJECT_NAME

Possible cause for the error is that the GroupName is already used by another object in the database.

Remarks

sp_CreateGroup creates a user group object in the database. A user group can be used to logically group users with similar object access rights together. By default, a user inherits rights from the groups that he is a member of. By granting rights to user groups instead of users, it makes it simpler to add and remove access rights to multiple users. A user can become a member of a user group by calling the sp_AddUserToGroup.

Note When a database is created, it does not perform access rights checking by default. In order to enforce the access rights of the users, the VERIFY_ACCESS_RIGHTS property of the database must be set to True by calling the sp_ModifyDatabase.

Example

After making a connection to the database, create a user group named "Managers" in the database and grant the user group read and update permissions to the "Employees" table.

EXECUTE PROCEDURE sp_CreateGroup(

‘Managers’,

‘All managers are in this group.’ );

 

GRANT SELECT,UPDATE ON Employees To Managers;

See Also

sp_DropGroup

sp_ModifyGroupProperty

sp_CreateUser

sp_DropUser

sp_AddUserToGroup

sp_RemoveUserFromGroup