sp_addgroup

Description

Adds a group to a database. Groups are used as collective names in granting and revoking privileges.

Syntax

sp_addgroup grpname

Parameters

grpname

is the name of the group. Group names must conform to the rules for identifiers.

Examples

Example 1

Creates a group named accounting in the current database:

sp_addgroup accounting

Usage

Permissions

The permission checks for sp_addgroup differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be a user with manage any user privilege.

Granular permissions disabled

With granular permissions disabled, you must be the database owner, a user with sso_role, or a user with sa_role.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Commands grant, revoke

System procedures sp_adduser, sp_changegroup, sp_dropgroup, sp_helpgroup