如何通过脚本将SQL Server中存储过程的删除权限授予用户?
我尝试了以下操作,但它不起作用
use XpressFeed_Dev
GRANT DROP ON procedure::getPartyDuns TO "INT\svc-w-corerefdata-de";
use XpressFeed_Dev
ALTER AUTHORIZATION ON [getPartyDuns] TO "INT\svc-w-corerefdata-de";
答案 0 :(得分:0)
您必须在过程名称之前指定架构 - 如下所示:
$(document).ready(function () {
//jQuery DataTables initialization
$('#myDatatable').DataTable({
"processing": true, // for show processing bar
"serverSide": true, // for process on server side
"orderMulti": true, // for disable multi column order
"dom": '<"top"i>rt<"bottom"lp><"clear">', // for hide default global search box // little confusion? don't worry I explained in the tutorial website
"ajax": {
"url": '/Users/GetAllUsers',
"type": "POST",
"datatype": "json"
},
"columns": [
{
"data": "User_FirstName", "autoWidth": true
},
{
"data": "User_LastName", "autoWidth": true
},
{ "data": "User_IsActive", "autoWidth": true },
{ "data": "User_Email", "autoWidth": true },
{ "data": "User_UserName", "autoWidth": true },
//{ "data": "User_UserType", "autoWidth": true },
{
"data": "User_Id",
"render": function (data, type, full, meta) {
var v_count = full['User_IsActive'];
if (!v_count) {
return '<a class="btn btn-verify " href="#">Enable<i class="fa fa-check wow fadeInRightBig"></i></a>';
} else if (v_count) {
return '<a class="btn btn-verify " href="#">Disable<i class="fa fa-ban wow fadeInRightBig" aria-hidden="true"></i></i></a>';
}
}
},
{
"data": "User_Id",
"render": function (data, type, full, meta) {
var v_count = full['User_UserType'];
if (v_count!=null) {
return '<a class="wow fadeInRightBig" href="#">' + v_count + '<i class="fa fa-check "></i></a>';
} else if (v_count) {
return '<a class="btn btn-verify " href="#">Disable<i class="fa fa-ban wow fadeInRightBig" aria-hidden="true"></i></i></a>';
}
}
}
]
});
答案 1 :(得分:0)
权限
需要对过程的CONTROL权限或ALTER权限 过程所属的模式,或者过程中的成员资格 db_ddladmin固定服务器角色。
因此,上述所有内容的最低权限为control
,因为在删除之后,用户将没有其他权限
GRANT CONTROL ON object::getPartyDuns TO [INT\svc-w-corerefdata-de];