授予对特定数据库中所有存储过程的执行权限 [英] Granting execute permission on all stored procedures in a certain database

查看:110
本文介绍了授予对特定数据库中所有存储过程的执行权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所示,我需要授予数据库中每个存储过程的执行权限.我们已经从测试转移到生产,并且对生产数据库的控制较少..并且所有导入的存储过程现在都具有零权限.有趣的事情是,是否有任何方法可以确保所有导入的存储过程从一开始就获得执行权限?

As the title suggests, I need to grant the execute permission on every stored procedure in a database. We've moved from test to production and have less control over the production database.. and all of the imported stored procedures got zero permissions right now. An interesting thing to know is if there is any way to make sure all of the imported stored procedures get execute permissions from the beginning?

感谢您的帮助.

推荐答案

生成语句,然后将其复制并粘贴到查询窗口中以运行它们

Generate the statements, then copy them and paste into query window to run them

select 'grant execute on ' + 
    QuoteName(specific_schema) + '.' +
    QuoteName(specific_name) + ' to someone'
from information_schema.routines
where routine_type='PROCEDURE'

这篇关于授予对特定数据库中所有存储过程的执行权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆