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

Select joining table based on condition
Linked server with same server name
How to group by two dates to sum an quantity
Retrieving record to a combo box in vb.net
Need select 2 rows from Table2, which is joined with Table1. See description
Can't add a connection in Visual Studio: no server name available
Average of a date column in sql [duplicate]
How to get the previous row value with an ORDERING BY DATE?
How to disable/enable full text indexed in SQL Server using dynamic SQL?
Generate DDL (Create) in SSIS from an Input Source
SQL Server Foreign Keys across multiple table levels
Delete some symbols from Sql Server
error of loading geometry data from csv file to Spatialite
TSQL: how to eliminate join on Null values when Column value is available
Create multiple foreign keys referes to the same table in EF code first
Suppress header output of T-SQL query

Categories

HOME
sharepoint
signalr
npm
amazon-swf
rotation
freepascal
angular2-routing
visualization
actionscript
codeeffects
heap-memory
quill
filter
browserify
urlencode
internet-explorer-11
dropbox
height
jboss-eap-7
public-key-encryption
rapidjson
jcl
google-people
kadanes-algorithm
uiautomator
autolayout
ghost-inspector
avplayeritem
bcrypt
searchbar
python-textprocessing
net-snmp
continuous-deployment
lync-2013
fetch-api
edge-detection
bitcoin-testnet
red-black-tree
android-vpn-service
postgresql-9.2
google-drive-realtime-api
data-extraction
salesforce-chatter
remote-server
office365connectors
image-compression
mongoexport
concrete5-5.7
s3cmd
cross-entropy
homekit
pytest-django
rich-text-editor
z3py
gauss
gist
seamless-immutable
jgraph
ruby-on-rails-2
rpostgresql
mcrypt
emoticons
inject
webkit2
instruments
cmocka
android-cursoradapter
enyo
mirrorlink
wikitext
datasnap
registrykey
uialertview
anti-patterns
wif
twython
digits
lines-of-code
guzzle6
start-job
inputaccessoryview
temp-tables
eclipse-classpath
yahoo-boss-api
boost-test
map-force
anjuta
roxygen
document-database
modeshape
sql-server-2012-web
ienumerator
justgage
lame
database-permissions
reporting-tools
vertical-scrolling
angularjs-timeout
marmalade-edk
mozart-mvc
socketstream
enumerators
returnurl
qsqltablemodel
makefile-project
flexicious
v4l
wchar
hashalgorithm
datamember
opengl-es-lighting
junit3
audiostreamer
.app
rijndael
libavformat
unreachable-code
camtasia
clients
scatterview
weborb

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