2

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.

4

2 に答える 2

2

セキュリティ上の問題になる可能性がある、テーブルに対するユーザー アクセス許可を付与するのではなく、ALTERその特定のストアド プロシージャを、それらのアクセス許可を持つ別のユーザーとして実行します。EXECUTE ASこれを行うには、構文を使用します。

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

于 2010-01-05T15:33:07.870 に答える
2

ユーザーには、「少なくとも」ALTER問題のテーブルに対する権限が必要です。参照: http://technet.microsoft.com/en-us/library/ms182706.aspx

于 2010-01-05T15:24:56.453 に答える