Transact-SQL Reference
sp_addgroup
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 sysadmin fixed server role, and the db_securityadmin and db_owner fixed database roles can execute sp_addgroup.
Examples
This example creates the group accounting.
EXEC sp_addgroup 'accounting'