需要哪些数据库用户权限?

发布于 2024-08-16 20:16:25 字数 432 浏览 6 评论 0原文

仅供参考:SQL Server 2005

我有一个数据库用户帐户 (user_web),它能够连接到我的数据库并在其中运行查询和存储过程。具体来说,我为用户授予了 db_datareader 和 db_datawriter 角色,并授予他们对其需要能够运行的特定存储过程的执行权限。

在其中一个存储过程中,我需要禁用触发器,然后在完成一些特定编辑后重新启用它。当我尝试与用户一起运行该存储过程时,出现以下错误:

Cannot find the object "TableName" because it does not exist or you do not have permissions.

TableName 是我尝试禁用和启用触发器的表。我的问题是我可以授予我的用户帐户以允许其成功运行存储过程的最少权限是多少。

FYI: SQL Server 2005

I have a database user account (user_web) that has the ability to connect to and run queries and stored procedures in my database. Specifically, I have given the user the db_datareader and db_datawriter roles as well as granted them execute permission on the specific stored procedures it needs to be able to run.

In one of the stored procedures, I need to disable a trigger then re-enable it after some specific edits are done. When I attempt to run that stored procedure with the user I get the following error:

Cannot find the object "TableName" because it does not exist or you do not have permissions.

TableName is the table where I am attempting to disable and enable the trigger. My question is what is the least amount of permissions I can give to my user account that will allow it to successfully run the stored procedure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

转身泪倾城 2024-08-23 20:16:26

用户“至少”需要对相关表的 ALTER 权限。请参阅:http://technet.microsoft.com/en-us/library/ ms182706.aspx

The user will "at a minimum" require ALTER permissions on the table in question. See: http://technet.microsoft.com/en-us/library/ms182706.aspx

ゞ记忆︶ㄣ 2024-08-23 20:16:26

我不会授予用户对表的 ALTER 权限(这可能是一个安全问题),而是让该特定存储过程作为具有这些权限的其他用户运行。使用 EXECUTE AS 语法来完成此操作。

http://msdn.microsoft.com/en-us/library/ms188354。 ASPX

Rather than grant the user ALTER permissions on the table, which could be a security issue, I'd have that particular stored procedure run as a different user that does have those permissions. Use the EXECUTE AS syntax to accomplish this.

http://msdn.microsoft.com/en-us/library/ms188354.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文