Export (0) Print
Expand All
Expand Minimize

sp_addgroup (Transact-SQL)

SQL Server 2005

Creates a group in the current database.

ms178554.note(en-US,SQL.90).gifImportant:
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).

Topic link icon 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' ;
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft