sp_addgroup (T-SQL)

Creates a group in the current database. sp_addgroup is included for backward compatibility. Microsoft® SQL Server™ version 7.0 uses roles instead of groups. Use sp_addrole to add a role.

Syntax

sp_addgroup [@grpname =] 'group'

Arguments
[@grpname =] 'group'
Is the name of the group to add. group is sysname, with no default.
Return Code Values

0 (success) or 1 (failure)

Remarks

sp_addgroup calls sp_addrole to add the new group.

Permissions

Only members of the db_securityadmin and db_owner fixed database roles can execute sp_addgroup.

Examples

This example creates the group accounting.

EXEC sp_addgroup 'accounting'

  

See Also
sp_addrole sp_helpgroup
sp_changegroup sp_helprole
sp_dropgroup System Stored Procedures

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.