SQL 授予特定角色 ALTER 访问特定表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9222569/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
GRANT specific role ALTER access to specific table
提问by Matt Rowles
I have tried many ways to do this with no success, but what I want to do is the following:
我尝试了很多方法都没有成功,但我想做的是以下几点:
GRANT ALTER ON [dbo].[theTable] TO [role]
Bonus if you can also provide me some permission state before & after eg.
如果您还可以在例如之前和之后为我提供一些许可状态,则奖励。
SELECT *
FROM fn_my_permissions('dbo.theTable', 'TABLE');
Many thanks in advance :)
提前谢谢了 :)
回答by user2537968
GRANT ALTER ON [dbo].[theTable] TO [role]
GO
回答by Andriy M
GRANT ALTER ON objectTO principal
is the correct form of the statement in your case.
GRANT ALTER ON objectTO principal
是您案例中陈述的正确形式。
To view the permissions granted to you on the object, use the fn_my_permissions
function like this:
要查看授予您的对象权限,请使用如下fn_my_permissions
函数:
SELECT *
FROM sys.fn_my_permissions('object', 'OBJECT')
;