In SQL Server, I would like to create a role that has the ability to manipulate database objects as well as create other roles and grant those roles subsets of its permissions.
CREATE ROLE deploymentRole;
CREATE ROLE subRole;
GRANT SELECT TO deploymentRole WITH GRANT OPTION;
CREATE TABLE dbo.testTable (id INT NULL);
CREATE USER deployUser WITHOUT LOGIN;
ALTER ROLE deploymentRole ADD MEMBER deployUser;
EXECUTE AS USER = 'deployUser';
--This works
SELECT * FROM dbo.testTable
--This also works
GRANT SELECT TO subRole …
Run Code Online (Sandbox Code Playgroud)