4
4

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 3 years have passed since last update.

SQLServerのオブジェクトの付与権限の確認方法

Last updated at Posted at 2020-10-28
--指定したオブジェクトの権限一覧を表示する
SELECT
OBJECT_NAME(major_id) AS オブジェクト
,USER_NAME(grantee_principal_id) AS ユーザー
,permission_name as 権限名
,state_desc as 権限の状態
FROM sys.database_permissions
WHERE major_id = OBJECT_ID('オブジェクトの名前')
--指定したユーザー(ロール)の権限一覧を表示する
SELECT
USER_NAME(grantee_principal_id) AS ユーザー
,OBJECT_NAME(major_id) AS オブジェクト
,permission_name as 権限名
,state_desc as 権限の状態
FROM sys.database_permissions
WHERE grantee_principal_id = USER_ID('ユーザーの名前かロールの名前')
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?