Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server database roles

As I understand it, Users assigned to the db_datareader role have the rights to read all tables in the database and those assigned to db_datawriter can update all tables.

Is there a database role that gives a user rights to execute all stored procedures?

like image 976
Chad Avatar asked Jan 11 '12 20:01

Chad


People also ask

What are the database roles?

There are two types of database-level roles: fixed-database roles that are predefined in the database and user-defined database roles that you can create. Fixed-database roles are defined at the database level and exist in each database. Members of the db_owner database role can manage fixed-database role membership.

What is the difference between database role and application role in SQL Server?

You can use application roles to enable access to specific data to only those users who connect through a particular application. Unlike database roles, application roles contain no members and are inactive by default. Application roles are enabled by using sp_setapprole, which requires a password.

What SQL Server role gives permissions at the database level?

Every SQL Server securable has associated permissions that can be granted to a principal. Permissions in the Database Engine are managed at the server level assigned to logins and server roles, and at the database level assigned to database users and database roles.

How do I get a list of user roles in SQL Server?

To find all the role assignments to users in SQL Server database, you can use the following query. SELECT r.name role_principal_name, m.name AS member_principal_name FROM sys. database_role_members rm JOIN sys. database_principals r ON rm.


1 Answers

You have to roll your own.

CREATE ROLE db_executor;
GRANT EXECUTE TO db_executor;
EXEC sp_addrolemember 'db_executor', 'username';
like image 106
Joe Stefanelli Avatar answered Oct 21 '22 09:10

Joe Stefanelli