sp_addgroup (Transact-SQL)
Creates a group in the current database.
Important
sp_addgroup provides compatibility with earlier versions of SQL Server. This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use roles instead. For more information, see CREATE ROLE (Transact-SQL).
Transact-SQL Syntax Conventions
sp_addgroup [ @grpname = ] 'group'
- [ @grpname = ] 'group'
Is the name of the group to add. group is sysname, with no default.
0 (success) or 1 (failure)
To add the new group, sp_addgroup calls sp_addrole.
Requires CREATE ROLE permission on the database.
The following example creates the group accounting
.
EXEC sp_addgroup 'accounting' ;
Security Stored Procedures (Transact-SQL)
CREATE ROLE (Transact-SQL)
sp_changegroup (Transact-SQL)
sp_dropgroup (Transact-SQL)
sp_helpgroup (Transact-SQL)
sp_helprole (Transact-SQL)
System Stored Procedures (Transact-SQL)