sql-server


T-SQL How to grant role to user with ADMIN/GRANT option in SQL Server 2008


After creating roles and granting privileges to them, I want to grant the privileges of a specified role to a user with grant option so that the user can grant privileges to others, how to do with it?
GRANT INSERT ON someTable TO rolem_has_some_permissions WITH GRANT OPTION
GO
EXEC sp_addrolemember 'rolem_has_some_permissions', 'sabertazimi'
GO
Doing like this can't make 'sabertazimi' to grant his privileges to others.
The stored procedure sp_addrolemember has 2(two) parameters only:
sp_addrolemember [ #rolename = ] 'role', [ #membername = ] 'security_account'
WITH GRANT OPTION has nothing to do with sp_addrolemember, instead it is the option of GRANT.
edited:
If you want your role members to be able to grant their permissions to others, you should grant these permissions to the role with the grant option.
When the user has to grant a permission to some other user, he must use the additional AS clause like this:
grant select on myTbl to AnotherUser as MyRole

Related Links

Azure Recovery Vault Backup is failing for SQL VMs
excel via for Mac 2011 SQL Server
multiple declare statements with one creating a temporary table
SQL Query is taking infinite time when using with order by
SAS query issue on external DBMS TABLE where Column Name has space
Try-Catch with Stored Procedures in SQL server
Is there an analogy between a recursive SQL query and a recursive function?
stored procedure 'auto_pk_for_table' not found
OUTPUT is not displaying more than ch3794, col 3794, Ln 35,
Insert/update datetime from VB6 to SQL Server
When calling process from SQLCLR, must the called process be 64bit?
SQL Server 2008 - Computed Column Extract Only Numeric From Other Column [duplicate]
Simple SELECT query with calculated columns returns error
Code required to run a query on the first day of each month
Is this an efficient design for a table with composite keys? [migrated]
Search for a string across all the databases in SQL SERVER and list all the databases, tables and corresponding columns

Categories

HOME
rotation
uibutton
angular2-routing
jasmine
survival-analysis
phpstorm
mainframe
jrebel
algorithmic-trading
quill
apiconnect
eval
deeplearning4j
keystore
cartodb
android-source
data-synchronization
ida
netezza
python-unicode
apache-karaf
pyyaml
google-people
flat-file
prestodb
plupload
android-fragmentactivity
autolayout
apple-tv
hhvm
cocoa-touch
azure-servicebus-queues
tfs2013
tampermonkey
python-textprocessing
data-cleansing
google-api-dotnet-client
piecewise
skygear
pdflatex
node-horseman
nodeclipse
discord.net
concrete5-5.7
fltk
dart-pub
datalog
median
openweathermap
tableau-server
double-buffering
ideone
udev
openh264
rpostgresql
mcrypt
static-code-analysis
castle-dynamicproxy
opencpu
pdfkit
svn-merge
inject
cfeclipse
debugdiag
webkit2
unsatisfiedlinkerror
qregexp
listadapter
shipitjs
emokit
codesign
project-online
axes
acm
unity5.3
rad
risk-analysis
scrollspy
low-level
sqoop2
cloudpebble
snmp4j
cdata
localtime
grunt-contrib-compass
cbcentralmanager
bulbs
fotoware
caliper
getstring
die
ajax.beginform
nsindexpath
nemerle
curljs
ihttphandler
mvccontrib-grid
recordset
osx-leopard
grooveshark
system-codedom-compiler
evb
virtualquery
hardware-infrastructure

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App