To add logins to the server and, optionally, to add users with appropriate roles and authorization to one or more databases, follow the general procedure described in Table 8-4.
Task |
Required role |
Command or procedure |
See |
---|---|---|---|
1. Add a login for the user. |
System Security Officer |
sp_addlogin |
System Administration Guide |
2. Add the user to one or more databases. |
System Security Officer, System Administrator, or Database Owner |
sp_adduser Enter this procedure from within the database. |
System Administration Guide |
3. Add the user to a group in a database. |
System Security Officer, System Administrator, or Database Owner |
sp_changegroup Enter this procedure from within the database. |
System Administration Guide Reference Manual: sp_changegroup |
4. Grant system roles to the user. |
System Administrator or System Security Officer |
grant role |
System Administration Guide Reference Manual: grant |
5. Create user-defined roles and grant the roles to users. |
System Security Officer |
create role grant role |
System Administration Guide Reference Manual: create role, grant role |
6. Grant access to database objects. |
Database object owner |
grant [select | insert | delete | update| references | execute ] |
System Administration Guide |