本文介绍了对所有存储过程执行 GRANT EXECUTE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下命令是否有效地授予用户MyUser"执行数据库中所有存储过程的权限?

Does the following command effectively give the user, "MyUser," permission to execute ALL stored procedures in the database?

GRANT EXECUTE TO [MyDomainMyUser]

推荐答案

SQL Server 2008 及更高版本:

SQL Server 2008 and Above:

/* CREATE A NEW ROLE */
CREATE ROLE db_executor

/* GRANT EXECUTE TO THE ROLE */
GRANT EXECUTE TO db_executor

仅针对用户(而非角色):

For just a user (not a role):

USE [DBName]
GO
GRANT EXECUTE TO [user]

这篇关于对所有存储过程执行 GRANT EXECUTE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 11:42