6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【SQL Server】ストアドプロシージャ実行権限を付ける

Posted at

概要

SQL Serverでユーザーに検索や書込みの権限を与える場合、定義済みのロールdata_readerdata_writerを割り当てれば良い。しかし、これだけではストアドプロシージャの実行権限は付かない。実行権限が付くロールは用意されていないので、自分で作成する必要がある。

サンプル

-- ロールを作成
CREATE ROLE db_execute
-- 作成したロールに「実行」権限を与える
GRANT EXECUTE TO db_execute
-- 作成したロールをユーザーに割り当てる
ALTER ROLE db_execute ADD MEMBER [ユーザー名]
6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?