Permissions: Create and Maintain Fixed Roles

Custom Roles:
Roles can be created by any user assigned to the CREATE ROLE permission or a member of the db_securityadmin fixed database role.
Database Roles:
SQL Server does indeed come with several built in fixed database roles. They are:
  • db_owner
  • db_securityadmin
  • db_accessadmin
  • db_backupoperator
  • db_ddladmin
  • db_datawriter
  • db_datareader
  • db_denydatawriter
  • db_denydatareader
Description:
db_owner   
  • can perform all configuration and maintenance activities on the database, and can also drop the database in SQL Server.
db_securityadmin   
  •  can modify role membership and manage permissions. Adding principals to this role could enable unintended privilege escalation.
db_accessadmin   
  • can add or remove access to the database for Windows logins, Windows groups, and SQL Server logins.
db_backupoperator   
  •  can back up the database.
db_ddladmin   
  •  can run any Data Definition Language (DDL) command in a database.
db_datawriter   
  •  can add, delete, or change data in all user tables.
db_datareader   
  •  can read all data from all user tables.
db_denydatawriter   
  • cannot add, modify, or delete any data in the user tables within a database.
db_denydatareader   
  •  cannot read any data in the user tables within a database.
Mapping Database Roles to Users using SSMS:
To review an individual user’s database roles for an particular database simply connect to your SQL Server, locate the applicable database in the Databases drop-down and then expand that database’s drop-down and locate the Security option.  Expand Security, expand Logins and locate the user’s login that you want to review.  Right-click the login and select Properties.
Once the Database User window is displayed, click on the Membership page to review the list of available database roles.
Another method for adding users to a particular database role is to add them directly to the role from within the role’s properties window, as opposed to adding the role to the user through their login properties as previously discussed.
To do this locate the individual database, expand the Security drop-down and then expand Roles and Database Roles.  Here you will see the familiar list of fixed database roles.

Right-click a particular role to view it’s properties. At the bottom of the screen you will see a list of all users assigned to this role.  To add additional users, just click the Add… button and provide the necessary account information.
Server Roles:
SQL Server does indeed come with several built in fixed server roles. They are:
  • sysadmin
  • bulkadmin
  • dbcreator
  • diskadmin
  • processadmin
  • securityadmin
  • serveradmin
  • setupadmin
Description:
sysadmin
  • This role can do anything within SQL Server.
  • This role completely bypasses all security checks.
  • This role can do everything any other role can do and more.
  • This is the most powerful role in SQL Server. Limit its access to only those who absolutely need it.
bulkadmin
  • This role allows the import of data from external files.
  • Even being a member of this role isn't enough. You also have to have INSERT rights on the table.
  • can run the BULK INSERT statement
dbcreator
  • This role allows creation of databases within SQL Server.
  • can create, alter, drop, and restore any database.
diskadmin
  • used for managing disk files
processadmin
  • This is a powerful role because it can kill connections to SQL Server.
  • can end processes that are running in an instance of SQL Server
securityadmin
  • Members of the securityadmin fixed server role manage logins and their properties. They can GRANT, DENY, and REVOKE server-level permissions. They can also GRANT, DENY, and REVOKE database-level permissions. Additionally, they can reset passwords for SQL Server logins
serveradmin
  • This role manages the SQL Server configuration.
  •  can change server-wide configuration options and shut down the server
setupadmin
  • Setup admin basically gives control over linked servers.
  • can add and remove linked servers
Assign Server Roles to Logins Using SSMS:
Using SQL Server Management Studio, expand the Security option (at the server level, not at the database level) and right click logins.
Right Click on Login Name & Choose Properties:
Goto Server Roles:

Another method for adding logins to a particular server role is to add them directly to the role from within the role’s properties window, as opposed to adding the role to the user through their login properties as previously discussed.
To do this connect to object explorer, expand the Security drop-down and then expand Server Roles. Here you will see the familiar list of fixed server roles with assigned logins.

Assign Server Roles to Logins Using TSQL:

Below code snippet will add new SQL member to existing Server Role: sysadmin
GO
ALTER SERVER ROLE [sysadmin]
ADD MEMBER [Anurag];
GO




Name

Azure Backup Database Clustering Crash Dumps DBCC Deadlock Link Server Log Shipping Maintenance Migration Mirroring Monitoring Performance Tuning Permissions Post Installations Prerequisites Replication Restore Database SQL Installations SQL on Linux SQL Uninstallations SSIS T-SQL Windows Server
false
ltr
item
hybriddba.blogspot.com: Permissions: Create and Maintain Fixed Roles
Permissions: Create and Maintain Fixed Roles
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ToI8-Grr-_Ki3dxXeDbymlQ6-FSgujF2gH_HMJACZW5X_wOjrpsZRTdaudqL_24azDD4HkKIzoq9koSEAQ92pe0lUcmMd-JucRJLd0ue-sG32VALrDQrKrHF9jwd2ETsLuyErAn_JKOQ/s1600/1579185115944170-0.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4ToI8-Grr-_Ki3dxXeDbymlQ6-FSgujF2gH_HMJACZW5X_wOjrpsZRTdaudqL_24azDD4HkKIzoq9koSEAQ92pe0lUcmMd-JucRJLd0ue-sG32VALrDQrKrHF9jwd2ETsLuyErAn_JKOQ/s72-c/1579185115944170-0.png
hybriddba.blogspot.com
https://hybriddba.blogspot.com/2018/08/permissions-create-and-maintain-fixed.html
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/2018/08/permissions-create-and-maintain-fixed.html
true
7679493960263860249
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy