CREATE ROLE

Create a new database role in the current database.

Syntax
      CREATE ROLE role [AUTHORIZATION owner]

Key
   role     The role to create.
   owner    The database user or role that is to own the new role.
              (default=the user that executes the CREATE ROLE command.)
 

Starting in SQL Server 2005 the behavior of schemas changed in that schemas are no longer equivalent to database users.

Example

CREATE ROLE nurses AUTHORIZATION JaneDoe;
GO CREATE ROLE doctors AUTHORIZATION db_securityadmin; GO

"I don't know if I believe in role models. We're all so different; we're all individuals. In the long run, that's what matters" - Wilson Cruz

Related commands:

ALTER ROLE
DROP ROLE
sys.database_role_members
sp_addrolemember - Add members to a role
Equivalent Oracle command: CREATE ROLE


 
Copyright © SS64.com 1999-2019
Some rights reserved